Struct chargrid_menu::MenuInstance [−][src]
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]
M: MenuIndexFromScreenCoord,
pub fn choose_or_escape<M>(
&mut self,
view: &M,
input: Input
) -> Option<Result<T, Escape>> where
M: MenuIndexFromScreenCoord,
[src]
&mut self,
view: &M,
input: Input
) -> Option<Result<T, Escape>> where
M: MenuIndexFromScreenCoord,
pub fn choose_or_quit<M>(
&mut self,
view: &M,
input: Input
) -> Option<Result<T, Quit>> where
M: MenuIndexFromScreenCoord,
[src]
&mut self,
view: &M,
input: Input
) -> Option<Result<T, Quit>> where
M: MenuIndexFromScreenCoord,
pub fn choose_or_cancel<M>(
&mut self,
view: &M,
input: Input
) -> Option<Result<T, Cancel>> where
M: MenuIndexFromScreenCoord,
[src]
&mut self,
view: &M,
input: Input
) -> Option<Result<T, Cancel>> where
M: MenuIndexFromScreenCoord,
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]
fn clone(&self) -> MenuInstance<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug + Clone> Debug for MenuInstance<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for MenuInstance<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for MenuInstance<T> where
T: Send,
T: Send,
impl<T> Sync for MenuInstance<T> where
T: Sync,
T: Sync,
impl<T> Unpin for MenuInstance<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for MenuInstance<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,