pub trait MenuItemCollection<R> {
// Required methods
fn bounds_of(&self, nth: usize) -> Rectangle;
fn value_of(&self, nth: usize) -> R;
fn interact_with(&mut self, nth: usize) -> R;
fn selectable(&self, nth: usize) -> bool;
fn count(&self) -> usize;
fn draw_styled<D>(
&self,
text_style: &MonoTextStyle<'static, BinaryColor>,
display: &mut D,
) -> Result<(), D::Error>
where D: DrawTarget<Color = BinaryColor>;
}
Expand description
Menu-related extensions for object chain elements
Required Methods§
fn bounds_of(&self, nth: usize) -> Rectangle
fn value_of(&self, nth: usize) -> R
fn interact_with(&mut self, nth: usize) -> R
Sourcefn selectable(&self, nth: usize) -> bool
fn selectable(&self, nth: usize) -> bool
Whether an item is selectable. If not, the item will be skipped.
fn count(&self) -> usize
fn draw_styled<D>(
&self,
text_style: &MonoTextStyle<'static, BinaryColor>,
display: &mut D,
) -> Result<(), D::Error>where
D: DrawTarget<Color = BinaryColor>,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.