Back to Rust Lang

Traits

redirects/traits.md

latest593 B
Original Source

% Traits

<small>There is a new edition of the book and this is an old link.</small>

Traits abstract over behavior that types can have in common.

rust
pub trait Summarizable {
    fn summary(&self) -> String;
}

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