pub struct SelectButtonProps<V, F, G>where
V: FromStr + ToString + Eq + Hash + Clone + 'static,
<V as FromStr>::Err: Debug,
F: Fn(V) + Copy + 'static,
G: Fn() -> V + Copy + 'static,{
pub label: TextProp,
pub icon: Option<String>,
pub id: String,
pub values: Vec<(V, TextProp)>,
pub value: G,
pub on_change: F,
}
Expand description
Props for the SelectButton
component.
§Required Props
- label:
impl Into<TextProp>
- id:
impl Into<String>
- values: [
impl Into<Vec<(V, TextProp)>>
](Vec<(V, TextProp)>) - value: [
G
] - on_change: [
F
]
§Optional Props
- icon:
impl Into<String>
Fields§
§label: TextProp
§icon: Option<String>
§id: String
§values: Vec<(V, TextProp)>
§value: G
§on_change: F
Implementations§
Source§impl<V, F, G> SelectButtonProps<V, F, G>
impl<V, F, G> SelectButtonProps<V, F, G>
Sourcepub fn builder() -> SelectButtonPropsBuilder<V, F, G, ((), (), (), (), (), ())>
pub fn builder() -> SelectButtonPropsBuilder<V, F, G, ((), (), (), (), (), ())>
Create a builder for building SelectButtonProps
.
On the builder, call .label(...)
, .icon(...)
(optional), .id(...)
, .values(...)
, .value(...)
, .on_change(...)
to set the values of the fields.
Finally, call .build()
to create the instance of SelectButtonProps
.
Trait Implementations§
Auto Trait Implementations§
impl<V, F, G> Freeze for SelectButtonProps<V, F, G>
impl<V, F, G> !RefUnwindSafe for SelectButtonProps<V, F, G>
impl<V, F, G> !Send for SelectButtonProps<V, F, G>
impl<V, F, G> !Sync for SelectButtonProps<V, F, G>
impl<V, F, G> Unpin for SelectButtonProps<V, F, G>
impl<V, F, G> !UnwindSafe for SelectButtonProps<V, F, G>
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> 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 more