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: usizeIndex of the selected option relative to the original (full) list passed to the prompt.
value: TValue 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<ListOption<T>> for ListOption<T>where
T: PartialEq<T>,
impl<T> PartialEq<ListOption<T>> for ListOption<T>where T: PartialEq<T>,
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 ==.