pub struct Menu<I, C = NonCancellable> { /* private fields */ }
Implementations§
Source§impl<I, C> Menu<I, C>
impl<I, C> Menu<I, C>
pub fn from_cancellation( title: impl AsRef<str>, items: impl IntoIterator<Item = I>, cancellation: C, ) -> Result<Self, Error>
pub fn with_title(self, title: impl AsRef<str>) -> Self
pub fn set_title(&mut self, title: impl AsRef<str>) -> &mut Self
pub fn with_items( self, items: impl IntoIterator<Item = I>, ) -> Result<Self, Error>
pub fn set_items( &mut self, items: impl IntoIterator<Item = I>, ) -> Result<&mut Self, Error>
pub fn with_cancellation(self, cancellation: C) -> Self
pub fn set_cancellation(&mut self, cancellation: C) -> &mut Self
pub fn with_style(self, style: Style) -> Self
pub fn set_style(&mut self, style: Style) -> &mut Self
pub fn with_keybindings(self, map: KeyBindingMap) -> Self
pub fn set_keybindings(&mut self, map: KeyBindingMap) -> &mut Self
pub fn with_selected(self, index: usize) -> Result<Self, Error>
pub fn set_selected(&mut self, index: usize) -> Result<&mut Self, Error>
pub fn with_scroll(self, top_item_index: usize) -> Result<Self, Error>
pub fn set_scroll(&mut self, top_item_index: usize) -> Result<&mut Self, Error>
pub fn title(&self) -> &str
pub fn items(&self) -> &[I]
pub fn cancellation(&self) -> &C
pub fn style(&self) -> &Style
pub fn key_bindings(&self) -> &KeyBindingMap
pub fn selected_index(&self) -> usize
pub fn scroll_top_index(&self) -> usize
pub fn selected_item(&self) -> &I
pub fn output<'a>(&'a self) -> <C as Cancellation<&'a I>>::Output
pub fn is_cancellable(&self) -> bool
pub fn is_cancelling(&self) -> bool
pub fn set_cancelling(&mut self, is_it: bool)
pub fn run_command(&mut self, cmd: Command) -> Result<bool, Error>
pub async fn run(&mut self, app: &mut App) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl<I, C> Freeze for Menu<I, C>where
C: Freeze,
impl<I, C> RefUnwindSafe for Menu<I, C>where
C: RefUnwindSafe,
I: RefUnwindSafe,
impl<I, C> Send for Menu<I, C>
impl<I, C> Sync for Menu<I, C>
impl<I, C> Unpin for Menu<I, C>
impl<I, C> UnwindSafe for Menu<I, C>where
C: UnwindSafe,
I: 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