Skip to main content

Speaker

Trait Speaker 

Source
pub(crate) trait Speaker {
    // Required method
    fn speak(&self);
}
Expand description

Part 3: Interface-based polymorphism via trait objects (dynamic dispatch through a vtable pointer embedded in the fat pointer &dyn Speaker).

Required Methods§

Source

fn speak(&self)

Emits the sound associated with this speaker.

Implementors§