Rust logo
Rust 1.64.0-nightly
c396bb3b8

Traits

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

Traits abstract over behavior that types can have in common.

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

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