pub struct WidgetStates(/* private fields */);Expand description
The set of states a widget is in, as a byte rather than a hash set.
The reference passes a Set<WidgetState>. Eight states fit in eight bits, and a
Copy set with no allocation is what a paint walk that runs every frame wants — it
also means the set can take part in the rebuild hash, which a HashSet could not do
cheaply.
Implementations§
Source§impl WidgetStates
impl WidgetStates
Sourcepub const EMPTY: WidgetStates
pub const EMPTY: WidgetStates
In no state at all: at rest, reachable, valid, unselected.
Sourcepub const fn of(state: WidgetState) -> WidgetStates
pub const fn of(state: WidgetState) -> WidgetStates
The set holding state alone.
Sourcepub const fn with(self, state: WidgetState) -> WidgetStates
pub const fn with(self, state: WidgetState) -> WidgetStates
This set, plus state.
Sourcepub const fn without(self, state: WidgetState) -> WidgetStates
pub const fn without(self, state: WidgetState) -> WidgetStates
This set, less state.
Sourcepub const fn set(self, state: WidgetState, on: bool) -> WidgetStates
pub const fn set(self, state: WidgetState, on: bool) -> WidgetStates
This set, with state present or not according to on — the shape a widget
answering for its own selection wants.
Sourcepub const fn contains(self, state: WidgetState) -> bool
pub const fn contains(self, state: WidgetState) -> bool
Is the widget in this state?
Trait Implementations§
Source§impl BitOr<WidgetState> for WidgetStates
impl BitOr<WidgetState> for WidgetStates
Source§type Output = WidgetStates
type Output = WidgetStates
The resulting type after applying the
| operator.Source§fn bitor(self, state: WidgetState) -> WidgetStates
fn bitor(self, state: WidgetState) -> WidgetStates
Performs the
| operation. Read moreSource§impl Clone for WidgetStates
impl Clone for WidgetStates
Source§fn clone(&self) -> WidgetStates
fn clone(&self) -> WidgetStates
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for WidgetStates
Source§impl Debug for WidgetStates
impl Debug for WidgetStates
Source§impl Default for WidgetStates
impl Default for WidgetStates
Source§fn default() -> WidgetStates
fn default() -> WidgetStates
Returns the “default value” for a type. Read more
impl Eq for WidgetStates
Source§impl From<WidgetState> for WidgetStates
impl From<WidgetState> for WidgetStates
Source§fn from(state: WidgetState) -> WidgetStates
fn from(state: WidgetState) -> WidgetStates
Converts to this type from the input type.
Source§impl Hash for WidgetStates
impl Hash for WidgetStates
Source§impl PartialEq for WidgetStates
impl PartialEq for WidgetStates
impl StructuralPartialEq for WidgetStates
Auto Trait Implementations§
impl Freeze for WidgetStates
impl RefUnwindSafe for WidgetStates
impl Send for WidgetStates
impl Sync for WidgetStates
impl Unpin for WidgetStates
impl UnsafeUnpin for WidgetStates
impl UnwindSafe for WidgetStates
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.