Struct cargo_lambda_interactive::list_option::ListOption
source · pub struct ListOption<T> {
pub index: usize,
pub value: T,
}
Expand description
Represents a selection made by the user when prompted to select one or several options among those presented.
Fields§
§index: usize
Index of the selected option relative to the original (full) list passed to the prompt.
value: T
Value of the selected option.
Implementations§
source§impl<T> ListOption<T>
impl<T> ListOption<T>
sourcepub fn new(index: usize, value: T) -> ListOption<T>
pub fn new(index: usize, value: T) -> ListOption<T>
sourcepub fn as_ref(&self) -> ListOption<&T>
pub fn as_ref(&self) -> ListOption<&T>
Converts from &ListOption<T>
to ListOption<&T>
.
Trait Implementations§
source§impl<T> Clone for ListOption<T>where
T: Clone,
impl<T> Clone for ListOption<T>where
T: Clone,
source§fn clone(&self) -> ListOption<T>
fn clone(&self) -> ListOption<T>
Returns a copy 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 moresource§impl<T> Debug for ListOption<T>where
T: Debug,
impl<T> Debug for ListOption<T>where
T: Debug,
source§impl<T> Display for ListOption<T>where
T: Display,
impl<T> Display for ListOption<T>where
T: Display,
source§impl<T> PartialEq for ListOption<T>where
T: PartialEq,
impl<T> PartialEq for ListOption<T>where
T: PartialEq,
source§fn eq(&self, other: &ListOption<T>) -> bool
fn eq(&self, other: &ListOption<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T> Eq for ListOption<T>where
T: Eq,
impl<T> StructuralPartialEq for ListOption<T>
Auto Trait Implementations§
impl<T> Freeze for ListOption<T>where
T: Freeze,
impl<T> RefUnwindSafe for ListOption<T>where
T: RefUnwindSafe,
impl<T> Send for ListOption<T>where
T: Send,
impl<T> Sync for ListOption<T>where
T: Sync,
impl<T> Unpin for ListOption<T>where
T: Unpin,
impl<T> UnwindSafe for ListOption<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