pub struct SelectOption<T> {
pub label: String,
pub value: T,
}Expand description
A labelled value offered by Select.
Fields§
§label: StringThe text shown to the user.
value: TThe typed value submitted when this option is selected.
Implementations§
Source§impl<T> SelectOption<T>
impl<T> SelectOption<T>
Sourcepub fn new(label: impl Into<String>, value: T) -> Self
pub fn new(label: impl Into<String>, value: T) -> Self
Creates a selectable typed value with a display label.
label is plain text. Escape sequences in it are counted as ordinary
characters when the prompt measures its cells, so a pre-styled string
mis-aligns the field; style it through the prompt’s theme instead.
Auto Trait Implementations§
impl<T> Freeze for SelectOption<T>where
T: Freeze,
impl<T> RefUnwindSafe for SelectOption<T>where
T: RefUnwindSafe,
impl<T> Send for SelectOption<T>where
T: Send,
impl<T> Sync for SelectOption<T>where
T: Sync,
impl<T> Unpin for SelectOption<T>where
T: Unpin,
impl<T> UnsafeUnpin for SelectOption<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SelectOption<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