pub enum CheckedState {
Unchecked,
Checked,
Indeterminate,
}Expand description
Tri-state checked value for controls like checkboxes.
Radix models this as boolean | 'indeterminate'. In Fret we keep it Rust-native while
preserving the same user-facing outcomes.
Variants§
Implementations§
Source§impl CheckedState
impl CheckedState
pub fn is_on(self) -> bool
pub fn is_checked(self) -> bool
pub fn is_indeterminate(self) -> bool
Sourcepub fn toggle(self) -> CheckedState
pub fn toggle(self) -> CheckedState
Toggle behavior matching Radix CheckboxTrigger:
indeterminate->checked- otherwise boolean invert
Sourcepub fn to_semantics_checked(self) -> Option<bool>
pub fn to_semantics_checked(self) -> Option<bool>
Maps tri-state into Fret’s current semantics flag surface.
None represents the indeterminate/mixed state.
pub fn to_semantics_checked_state(self) -> Option<SemanticsCheckedState>
Trait Implementations§
Source§impl Clone for CheckedState
impl Clone for CheckedState
Source§fn clone(&self) -> CheckedState
fn clone(&self) -> CheckedState
Returns a duplicate 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 Debug for CheckedState
impl Debug for CheckedState
Source§impl Default for CheckedState
impl Default for CheckedState
Source§fn default() -> CheckedState
fn default() -> CheckedState
Returns the “default value” for a type. Read more
Source§impl From<bool> for CheckedState
impl From<bool> for CheckedState
Source§fn from(value: bool) -> CheckedState
fn from(value: bool) -> CheckedState
Converts to this type from the input type.
Source§impl PartialEq for CheckedState
impl PartialEq for CheckedState
impl Copy for CheckedState
impl Eq for CheckedState
impl StructuralPartialEq for CheckedState
Auto Trait Implementations§
impl Freeze for CheckedState
impl RefUnwindSafe for CheckedState
impl Send for CheckedState
impl Sync for CheckedState
impl Unpin for CheckedState
impl UnsafeUnpin for CheckedState
impl UnwindSafe for CheckedState
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