pub trait DefaultItem: Item {
// Required methods
fn title(&self) -> String;
fn description(&self) -> String;
// Provided method
fn as_default_item(&self) -> Option<&dyn DefaultItem>
where Self: Sized { ... }
}Expand description
DefaultItem describes an item designed to work with DefaultDelegate.
Required Methods§
Sourcefn description(&self) -> String
fn description(&self) -> String
Description returns the item’s description.
Provided Methods§
Sourcefn as_default_item(&self) -> Option<&dyn DefaultItem>where
Self: Sized,
fn as_default_item(&self) -> Option<&dyn DefaultItem>where
Self: Sized,
Returns Some(self) so the default delegate can view the item.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".