Skip to main content

Module check_state

Module check_state 

Source
Expand description

CheckState โ€” tri-state checkbox value shared by the data layer and widgets.

Represents the three visual states of a checkbox: unchecked, checked, and indeterminate (partial โ€” some but not all descendants are checked). Lives in teksilo-data rather than teksilo-widgets so that crate::TreeCheckedModel can produce Signal<CheckState> values without inverting the dependency graph.

From<bool> converts a plain two-state boolean (e.g. from a filter predicate) into Unchecked or Checked, making it easy to bridge non-tristate sources.

let state = CheckState::Indeterminate;
assert!(state.is_filled());
assert_eq!(state.next_tristate(), CheckState::Unchecked);
assert_eq!(CheckState::from(true), CheckState::Checked);

Enumsยง

CheckState