pub struct Options<T> { /* private fields */ }Expand description
A helper struct for the multi-option prompts
Implementations§
Source§impl<T> Options<T>
impl<T> Options<T>
Sourcepub fn from_iter_transformed<I, F>(iter: I, transformation: F) -> Self
pub fn from_iter_transformed<I, F>(iter: I, transformation: F) -> Self
Create Options from an arbitrary type using provided transformation function to String
Sourcepub fn filtered_options(&self) -> &[usize]
pub fn filtered_options(&self) -> &[usize]
Retrieve the indices of all options that satisfy the last applied filter
Sourcepub fn all_options_mut(&mut self) -> &mut Vec<T>
pub fn all_options_mut(&mut self) -> &mut Vec<T>
Get a mutable reference to the vector all available options
Sourcepub fn transformed_options(&self) -> &[String]
pub fn transformed_options(&self) -> &[String]
Get a reference to all options in their string representation
Auto Trait Implementations§
impl<T> Freeze for Options<T>
impl<T> RefUnwindSafe for Options<T>where
T: RefUnwindSafe,
impl<T> Send for Options<T>where
T: Send,
impl<T> Sync for Options<T>where
T: Sync,
impl<T> Unpin for Options<T>where
T: Unpin,
impl<T> UnwindSafe for Options<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