Trait MenuListItem

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

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.

Implementors§

Source§

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