pub trait Toggleable {
// Required method
fn toggle_state(self, selected: bool) -> Self;
}Expand description
A trait for elements that can be toggled.
Implement this for elements that are visually distinct when in two opposing states, like checkboxes or switches.
Required Methods§
Sourcefn toggle_state(self, selected: bool) -> Self
fn toggle_state(self, selected: bool) -> Self
Sets whether the element is selected.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".