Struct atspi_common::state::StateSet
source · 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: Into<BitFlags<State>>>(value: B) -> Self
pub fn new<B: Into<BitFlags<State>>>(value: B) -> Self
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 contains<B: Into<BitFlags<State>>>(self, other: B) -> bool
pub fn contains<B: Into<BitFlags<State>>>(self, other: B) -> bool
Whether the StateSet
contains a State
.
sourcepub fn remove<B: Into<BitFlags<State>>>(&mut self, other: B)
pub fn remove<B: Into<BitFlags<State>>>(&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
.
Trait Implementations§
source§impl BitAndAssign<StateSet> for StateSet
impl BitAndAssign<StateSet> for StateSet
source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Performs the
&=
operation. Read moresource§impl BitOrAssign<StateSet> for StateSet
impl BitOrAssign<StateSet> for StateSet
source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Performs the
|=
operation. Read moresource§impl BitXorAssign<StateSet> for StateSet
impl BitXorAssign<StateSet> for StateSet
source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Performs the
^=
operation. Read moresource§impl<'de> Deserialize<'de> for StateSet
impl<'de> Deserialize<'de> for StateSet
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<StateSet> for StateSet
impl PartialEq<StateSet> for StateSet
impl Copy for StateSet
impl Eq for StateSet
impl StructuralEq for StateSet
impl StructuralPartialEq for StateSet
Auto Trait Implementations§
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<'de, T> DynamicDeserialize<'de> for Twhere
T: Type + Deserialize<'de> + ?Sized,
impl<'de, T> DynamicDeserialize<'de> for Twhere T: Type + Deserialize<'de> + ?Sized,
§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>where
S: TryInto<Signature<'de>>,
<S as TryInto<Signature<'de>>>::Error: Into<Error>,
fn deserializer_for_signature<S>( signature: S ) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error>where S: TryInto<Signature<'de>>, <S as TryInto<Signature<'de>>>::Error: Into<Error>,
Get a deserializer compatible with this signature.
source§impl<T> DynamicType for Twhere
T: Type + ?Sized,
impl<T> DynamicType for Twhere T: Type + ?Sized,
source§fn dynamic_signature(&self) -> Signature<'_>
fn dynamic_signature(&self) -> Signature<'_>
Get the signature for the implementing type. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere T: Default,
type NoneType = T
source§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.