Rust logo
Rust 1.29.2
17a9dc751

Associated Types

There is a new edition of the book and this is an old link.

Associated types are a way of associating a type placeholder with a trait such that the trait method definitions can use these placeholder types in their signatures.

pub trait Iterator {
    type Item;
    fn next(&mut self) -> Option<Self::Item>;
}Run

Here are the relevant sections in the new and old books: