pub struct ListBoxGroup {
pub label: Option<String>,
pub options: Vec<SelectOption>,
}Expand description
A labelled run of options in a ListBox, like consecutive lumen-react options that share a
section.
use lumen_dioxus::{ListBoxGroup, SelectOption};
let groups = vec![
ListBoxGroup::new("Fruit", ["Apple", "Pear"]),
ListBoxGroup::ungrouped([SelectOption::new("water", "Water")]),
];
assert_eq!(groups[0].label.as_deref(), Some("Fruit"));
assert_eq!(groups[1].options[0].value, "water");Fields§
§label: Option<String>The section heading. None (or an empty label) renders the options without a group.
options: Vec<SelectOption>The options in the group.
Implementations§
Source§impl ListBoxGroup
impl ListBoxGroup
Sourcepub fn new<T: Into<SelectOption>>(
label: impl Into<String>,
options: impl IntoIterator<Item = T>,
) -> Self
pub fn new<T: Into<SelectOption>>( label: impl Into<String>, options: impl IntoIterator<Item = T>, ) -> Self
A labelled group.
Sourcepub fn ungrouped<T: Into<SelectOption>>(
options: impl IntoIterator<Item = T>,
) -> Self
pub fn ungrouped<T: Into<SelectOption>>( options: impl IntoIterator<Item = T>, ) -> Self
Options shown without a section heading.
Trait Implementations§
Source§impl Clone for ListBoxGroup
impl Clone for ListBoxGroup
Source§impl Debug for ListBoxGroup
impl Debug for ListBoxGroup
Source§impl Default for ListBoxGroup
impl Default for ListBoxGroup
impl Eq for ListBoxGroup
Source§impl Hash for ListBoxGroup
impl Hash for ListBoxGroup
Source§impl PartialEq for ListBoxGroup
impl PartialEq for ListBoxGroup
impl StructuralPartialEq for ListBoxGroup
Auto Trait Implementations§
impl Forget for ListBoxGroup
impl Freeze for ListBoxGroup
impl Move for ListBoxGroup
impl RefUnwindSafe for ListBoxGroup
impl Send for ListBoxGroupwhere
RawVecInner: Send,
impl Sync for ListBoxGroupwhere
RawVecInner: Sync,
impl Unpin for ListBoxGroup
impl UnsafeUnpin for ListBoxGroupwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<SelectOption>: UnsafeUnpin,
impl UnwindSafe for ListBoxGroupwhere
RawVecInner: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.