Struct chargrid_menu::MenuInstance[][src]

pub struct MenuInstance<T: Clone> { /* fields omitted */ }

Implementations

impl<T: Clone> MenuInstance<T>[src]

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

pub fn new(items: Vec<T>) -> Result<Self, InitialIndexOutOfBounds>[src]

pub fn up(&mut self)[src]

pub fn down(&mut self)[src]

pub fn set_index(&mut self, index: usize)[src]

pub fn index(&self) -> usize[src]

pub fn selected(&self) -> &T[src]

pub fn enumerate(&self) -> impl Iterator<Item = (usize, &T, Option<Selected>)>[src]

pub fn choose<M>(&mut self, view: &M, input: Input) -> Option<T> where
    M: MenuIndexFromScreenCoord
[src]

pub fn choose_or_escape<M>(
    &mut self,
    view: &M,
    input: Input
) -> Option<Result<T, Escape>> where
    M: MenuIndexFromScreenCoord
[src]

pub fn choose_or_quit<M>(
    &mut self,
    view: &M,
    input: Input
) -> Option<Result<T, Quit>> where
    M: MenuIndexFromScreenCoord
[src]

pub fn choose_or_cancel<M>(
    &mut self,
    view: &M,
    input: Input
) -> Option<Result<T, Cancel>> where
    M: MenuIndexFromScreenCoord
[src]

pub fn into_just_choose(self) -> MenuInstanceJustChoose<T>[src]

pub fn into_choose_or_escape(self) -> MenuInstanceChooseOrEscape<T>[src]

pub fn into_choose_or_quit(self) -> MenuInstanceChooseOrQuit<T>[src]

pub fn into_choose_or_cancel(self) -> MenuInstanceChooseOrCancel<T>[src]

Trait Implementations

impl<T: Clone> Clone for MenuInstance<T>[src]

impl<T: Debug + Clone> Debug for MenuInstance<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for MenuInstance<T> where
    T: RefUnwindSafe

impl<T> Send for MenuInstance<T> where
    T: Send

impl<T> Sync for MenuInstance<T> where
    T: Sync

impl<T> Unpin for MenuInstance<T> where
    T: Unpin

impl<T> UnwindSafe for MenuInstance<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.