pub struct RadioButton;Expand description
The RadioButton struct provides various methods to create and manage radio buttons.
§Related Functions
Implementations§
Source§impl RadioButton
impl RadioButton
Sourcepub fn new<T>(
represented_value: T,
actual_value: impl Fn() -> T + 'static,
) -> ValueContainer<T>
pub fn new<T>( represented_value: T, actual_value: impl Fn() -> T + 'static, ) -> ValueContainer<T>
Creates a new radio button with a closure that determines its selected state.
This method is useful when you want a radio button whose state is determined by a closure. The state can be dynamically updated by the closure, and the radio button will reflect these changes.
Sourcepub fn new_get<T>(
represented_value: T,
actual_value: impl SignalGet<T> + Copy + 'static,
) -> impl IntoView
pub fn new_get<T>( represented_value: T, actual_value: impl SignalGet<T> + Copy + 'static, ) -> impl IntoView
Creates a new radio button with a signal that provides its selected state.
Use this method when you have a signal that provides the current state of the radio button. The radio button will automatically update its state based on the signal.
Sourcepub fn new_rw<T>(
represented_value: T,
actual_value: impl SignalGet<T> + SignalUpdate<T> + Copy + 'static,
) -> impl IntoView
pub fn new_rw<T>( represented_value: T, actual_value: impl SignalGet<T> + SignalUpdate<T> + Copy + 'static, ) -> impl IntoView
Creates a new radio button with a signal that provides and updates its selected state.
This method is ideal when you need a radio button that not only reflects a signal’s state but also updates it. Clicking the radio button will set the signal to the represented value.
Sourcepub fn new_labeled<S: Display + 'static, T>(
represented_value: T,
actual_value: impl Fn() -> T + 'static,
label: impl Fn() -> S + 'static,
) -> ValueContainer<T>
pub fn new_labeled<S: Display + 'static, T>( represented_value: T, actual_value: impl Fn() -> T + 'static, label: impl Fn() -> S + 'static, ) -> ValueContainer<T>
Creates a new labeled radio button with a closure that determines its selected state.
This method is useful when you want a labeled radio button whose state is determined by a closure. The label is also provided by a closure, allowing for dynamic updates.
Sourcepub fn new_labeled_get<S: Display + 'static, T>(
represented_value: T,
actual_value: impl SignalGet<T> + Copy + 'static,
label: impl Fn() -> S + 'static,
) -> impl IntoView
pub fn new_labeled_get<S: Display + 'static, T>( represented_value: T, actual_value: impl SignalGet<T> + Copy + 'static, label: impl Fn() -> S + 'static, ) -> impl IntoView
Creates a new labeled radio button with a signal that provides its selected state.
Use this method when you have a signal that provides the current state of the radio button and you also want a label. The radio button and label will automatically update based on the signal.
Sourcepub fn new_labeled_rw<S: Display + 'static, T>(
represented_value: T,
actual_value: impl SignalGet<T> + SignalUpdate<T> + Copy + 'static,
label: impl Fn() -> S + 'static,
) -> impl IntoView
pub fn new_labeled_rw<S: Display + 'static, T>( represented_value: T, actual_value: impl SignalGet<T> + SignalUpdate<T> + Copy + 'static, label: impl Fn() -> S + 'static, ) -> impl IntoView
Creates a new labeled radio button with a signal that provides and updates its selected state.
This method is ideal when you need a labeled radio button that not only reflects a signal’s state but also updates it. Clicking the radio button will set the signal to the represented value.
Auto Trait Implementations§
impl Freeze for RadioButton
impl RefUnwindSafe for RadioButton
impl Send for RadioButton
impl Sync for RadioButton
impl Unpin for RadioButton
impl UnwindSafe for RadioButton
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
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>
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>
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