pub trait MenuListItem<R>: Marker + View {
    // Required methods
    fn value_of(&self) -> R;
    fn interact(&mut self) -> R;
    fn set_style(&mut self, text_style: &MonoTextStyle<'_, BinaryColor>);
    fn draw_styled<D>(
        &self,
        text_style: &MonoTextStyle<'static, BinaryColor>,
        display: &mut D
    ) -> Result<(), D::Error>
       where D: DrawTarget<Color = BinaryColor>;

    // Provided method
    fn selectable(&self) -> bool { ... }
}

Required Methods§

source

fn value_of(&self) -> R

Returns the value of the selected item, without interacting with it.

source

fn interact(&mut self) -> R

source

fn set_style(&mut self, text_style: &MonoTextStyle<'_, BinaryColor>)

source

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

Provided Methods§

source

fn selectable(&self) -> bool

Returns whether the list item is selectable.

If this returns false, the list item will not be interactable and user navigation will skip over it.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T, R, S, const SELECTABLE: bool> MenuListItem<R> for MenuItem<T, R, S, SELECTABLE>
where T: AsRef<str>, S: SelectValue,