Struct demand::DemandOption
source · pub struct DemandOption<T> {
pub item: T,
pub label: String,
pub selected: bool,
/* private fields */
}
Expand description
An individual option in a select or multi-select.
Fields§
§item: T
The item this option represents.
label: String
Display label for this option.
selected: bool
Whether this option is initially selected.
Implementations§
source§impl<T: ToString> DemandOption<T>
impl<T: ToString> DemandOption<T>
source§impl<T> DemandOption<T>
impl<T> DemandOption<T>
sourcepub fn with_label<S: Into<String>>(label: S, item: T) -> Self
pub fn with_label<S: Into<String>>(label: S, item: T) -> Self
Create a new option with a label and item
pub fn item<I>(self, item: I) -> DemandOption<I>
Trait Implementations§
source§impl<T: Clone> Clone for DemandOption<T>
impl<T: Clone> Clone for DemandOption<T>
source§fn clone(&self) -> DemandOption<T>
fn clone(&self) -> DemandOption<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> Debug for DemandOption<T>
impl<T: Debug> Debug for DemandOption<T>
source§impl<T: Display> PartialEq for DemandOption<T>
impl<T: Display> PartialEq for DemandOption<T>
impl<T: Display> Eq for DemandOption<T>
Auto Trait Implementations§
impl<T> Freeze for DemandOption<T>where
T: Freeze,
impl<T> RefUnwindSafe for DemandOption<T>where
T: RefUnwindSafe,
impl<T> Send for DemandOption<T>where
T: Send,
impl<T> Sync for DemandOption<T>where
T: Sync,
impl<T> Unpin for DemandOption<T>where
T: Unpin,
impl<T> UnwindSafe for DemandOption<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