pub struct MenuInstance<T: Clone> { /* private fields */ }Implementations§
Source§impl<T: Clone> MenuInstance<T>
impl<T: Clone> MenuInstance<T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn new(items: Vec<T>) -> Result<Self, InitialIndexOutOfBounds>
pub fn up(&mut self)
pub fn down(&mut self)
pub fn set_index(&mut self, index: usize)
pub fn index(&self) -> usize
pub fn selected(&self) -> &T
pub fn enumerate(&self) -> impl Iterator<Item = (usize, &T, Option<Selected>)>
pub fn choose<M>(&mut self, view: &M, input: Input) -> Option<T>where
M: MenuIndexFromScreenCoord,
pub fn choose_or_escape<M>(
&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,
pub fn choose_or_cancel<M>(
&mut self,
view: &M,
input: Input,
) -> Option<Result<T, Cancel>>where
M: MenuIndexFromScreenCoord,
pub fn into_just_choose(self) -> MenuInstanceJustChoose<T>
pub fn into_choose_or_escape(self) -> MenuInstanceChooseOrEscape<T>
pub fn into_choose_or_quit(self) -> MenuInstanceChooseOrQuit<T>
pub fn into_choose_or_cancel(self) -> MenuInstanceChooseOrCancel<T>
Trait Implementations§
Source§impl<T: Clone + Clone> Clone for MenuInstance<T>
impl<T: Clone + Clone> Clone for MenuInstance<T>
Source§fn clone(&self) -> MenuInstance<T>
fn clone(&self) -> MenuInstance<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for MenuInstance<T>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more