Trait MenuItemCollection

Source
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§

Source

fn bounds_of(&self, nth: usize) -> Rectangle

Source

fn value_of(&self, nth: usize) -> R

Source

fn interact_with(&mut self, nth: usize) -> R

Source

fn selectable(&self, nth: usize) -> bool

Whether an item is selectable. If not, the item will be skipped.

Source

fn count(&self) -> usize

Source

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.

Implementations on Foreign Types§

Source§

impl<I, LE, R> MenuItemCollection<R> for Link<I, LE>

Source§

fn bounds_of(&self, nth: usize) -> Rectangle

Source§

fn value_of(&self, nth: usize) -> R

Source§

fn interact_with(&mut self, nth: usize) -> R

Source§

fn selectable(&self, nth: usize) -> bool

Source§

fn count(&self) -> usize

Source§

fn draw_styled<D>( &self, text_style: &MonoTextStyle<'static, BinaryColor>, display: &mut D, ) -> Result<(), D::Error>
where D: DrawTarget<Color = BinaryColor>,

Source§

impl<I, R> MenuItemCollection<R> for Chain<I>
where I: MenuItemCollection<R>,

Source§

fn bounds_of(&self, nth: usize) -> Rectangle

Source§

fn value_of(&self, nth: usize) -> R

Source§

fn interact_with(&mut self, nth: usize) -> R

Source§

fn selectable(&self, nth: usize) -> bool

Source§

fn count(&self) -> usize

Source§

fn draw_styled<D>( &self, text_style: &MonoTextStyle<'static, BinaryColor>, display: &mut D, ) -> Result<(), D::Error>
where D: DrawTarget<Color = BinaryColor>,

Implementors§

Source§

impl<C, I, R> MenuItemCollection<R> for MenuItems<C, I, R>
where C: AsRef<[I]> + AsMut<[I]>, I: MenuListItem<R>,

Source§

impl<I, R> MenuItemCollection<R> for I
where I: MenuListItem<R> + Marker,