pub enum Toggle {
NotToggleable,
Toggled(bool),
}
Expand description
Whether the entry is toggleable, and if so, whether it is currently toggled.
To make an element toggleable, simply add a Toggle::Toggled(_)
and handle it’s cases.
You can check if an element is toggleable with .is_toggleable()
Possible values:
Toggle::NotToggleable
- The entry is not toggleableToggle::Toggled(true)
- The entry is toggleable and toggledToggle::Toggled(false)
- The entry is toggleable and not toggled
Variants§
Implementations§
source§impl Toggle
impl Toggle
sourcepub fn is_toggled(&self) -> bool
pub fn is_toggled(&self) -> bool
Returns true if the entry is toggled (or is not toggleable.)
As element that isn’t toggleable is always “expanded” or “enabled” returning true in that case makes sense.
pub fn is_toggleable(&self) -> bool
Trait Implementations§
source§impl PartialEq<Toggle> for Toggle
impl PartialEq<Toggle> for Toggle
impl Copy for Toggle
impl Eq for Toggle
impl StructuralEq for Toggle
impl StructuralPartialEq for Toggle
Auto Trait Implementations§
impl RefUnwindSafe for Toggle
impl Send for Toggle
impl Sync for Toggle
impl Unpin for Toggle
impl UnwindSafe for Toggle
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.