pub struct RadioOption<T> { /* private fields */ }Expand description
One typed value, label, and live disabled state in a radio group.
Duplicate equal values are ambiguous: every equal option paints checked, while selection lookup/navigation uses the first equal option.
§Examples
use ailloli_ui_widgets::controls::RadioOption;
let option = RadioOption::new("daily", "Daily");
let _ = option;Implementations§
Source§impl<T> RadioOption<T>
impl<T> RadioOption<T>
Sourcepub fn new(value: T, label: impl Into<String>) -> Self
pub fn new(value: T, label: impl Into<String>) -> Self
Creates an enabled typed option.
§Examples
use ailloli_ui_widgets::controls::RadioOption;
let option = RadioOption::new(1, "One");
let _ = option;Sourcepub fn disabled(self, disabled: impl Into<Binding<bool>>) -> Self
pub fn disabled(self, disabled: impl Into<Binding<bool>>) -> Self
Sets static or reactive per-option disabled state.
Disabled options remain visible and may paint checked but are skipped by navigation and cannot activate.
§Examples
use ailloli_ui_widgets::controls::RadioOption;
let option = RadioOption::new(1, "One").disabled(true);
let _ = option;Sourcepub fn disabled_signal(self, disabled: Memo<bool>) -> Self
pub fn disabled_signal(self, disabled: Memo<bool>) -> Self
Sets per-option disabled state from a derived memo.
§Examples
use ailloli_ui_runtime::component::Memo;
use ailloli_ui_widgets::controls::RadioOption;
let option = RadioOption::new(1, "One").disabled_signal(Memo::new(|| false));
let _ = option;Trait Implementations§
Source§impl<T: Clone> Clone for RadioOption<T>
impl<T: Clone> Clone for RadioOption<T>
Source§fn clone(&self) -> RadioOption<T>
fn clone(&self) -> RadioOption<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 moreAuto Trait Implementations§
impl<T> Freeze for RadioOption<T>where
T: Freeze,
impl<T> !RefUnwindSafe for RadioOption<T>
impl<T> !Send for RadioOption<T>
impl<T> !Sync for RadioOption<T>
impl<T> Unpin for RadioOption<T>where
T: Unpin,
impl<T> !UnwindSafe for RadioOption<T>
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.