pub struct StateSet(/* private fields */);
Expand description
The bitflag representation of all states an object may have.
Implementations§
source§impl StateSet
impl StateSet
sourcepub fn new<B>(value: B) -> StateSet
pub fn new<B>(value: B) -> StateSet
Create a new StateSet
.
§Example
let states = State::Focusable | State::Sensitive | State::Active;
let set = StateSet::new(states);
assert!(set.contains(State::Active));
assert!(!set.contains(State::Busy));
sourcepub fn remove<B>(&mut self, other: B)
pub fn remove<B>(&mut self, other: B)
Removes a State
(optionally) previously contained in the StateSet
.
sourcepub fn iter(self) -> impl Iterator<Item = State>
pub fn iter(self) -> impl Iterator<Item = State>
Returns an iterator that yields each set State
.
sourcepub fn intersects<B>(self, other: B) -> bool
pub fn intersects<B>(self, other: B) -> bool
Returns true if at least one flag is shared.
Trait Implementations§
source§impl BitAndAssign for StateSet
impl BitAndAssign for StateSet
source§fn bitand_assign(&mut self, other: StateSet)
fn bitand_assign(&mut self, other: StateSet)
Performs the
&=
operation. Read moresource§impl BitOrAssign for StateSet
impl BitOrAssign for StateSet
source§fn bitor_assign(&mut self, other: StateSet)
fn bitor_assign(&mut self, other: StateSet)
Performs the
|=
operation. Read moresource§impl BitXorAssign for StateSet
impl BitXorAssign for StateSet
source§fn bitxor_assign(&mut self, other: StateSet)
fn bitxor_assign(&mut self, other: StateSet)
Performs the
^=
operation. Read moresource§impl<'de> Deserialize<'de> for StateSet
impl<'de> Deserialize<'de> for StateSet
source§fn deserialize<D>(
deserializer: D,
) -> Result<StateSet, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<StateSet, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for StateSet
impl Serialize for StateSet
source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for StateSet
impl Eq for StateSet
impl StructuralPartialEq for StateSet
Auto Trait Implementations§
impl Freeze for StateSet
impl RefUnwindSafe for StateSet
impl Send for StateSet
impl Sync for StateSet
impl Unpin for StateSet
impl UnwindSafe for StateSet
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<'de, T> DynamicDeserialize<'de> for T
impl<'de, T> DynamicDeserialize<'de> for T
source§type Deserializer = PhantomData<T>
type Deserializer = PhantomData<T>
A DeserializeSeed implementation for this type.
source§fn deserializer_for_signature<S>(
signature: S,
) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error>
fn deserializer_for_signature<S>( signature: S, ) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error>
Get a deserializer compatible with this signature.
source§impl<T> DynamicType for T
impl<T> DynamicType for T
source§fn dynamic_signature(&self) -> Signature<'_>
fn dynamic_signature(&self) -> Signature<'_>
Get the signature for the implementing type. Read more