pub struct DispatchKeySet { /* private fields */ }Expand description
A set of active DispatchKeys, stored as a u16 bitmask for
constant-time membership testing and iteration.
Implementations§
Source§impl DispatchKeySet
impl DispatchKeySet
Sourcepub const fn empty() -> DispatchKeySet
pub const fn empty() -> DispatchKeySet
An empty set.
Sourcepub fn all() -> DispatchKeySet
pub fn all() -> DispatchKeySet
A set containing every defined key.
Sourcepub fn from_iter<I>(keys: I) -> DispatchKeySetwhere
I: IntoIterator<Item = DispatchKey>,
pub fn from_iter<I>(keys: I) -> DispatchKeySetwhere
I: IntoIterator<Item = DispatchKey>,
Construct a set from an iterable of keys.
Sourcepub fn contains(self, key: DispatchKey) -> bool
pub fn contains(self, key: DispatchKey) -> bool
Returns true if key is in this set.
Sourcepub fn insert(self, key: DispatchKey) -> DispatchKeySet
pub fn insert(self, key: DispatchKey) -> DispatchKeySet
Returns a new set with key added.
Sourcepub fn remove(self, key: DispatchKey) -> DispatchKeySet
pub fn remove(self, key: DispatchKey) -> DispatchKeySet
Returns a new set with key removed.
Sourcepub fn union(self, other: DispatchKeySet) -> DispatchKeySet
pub fn union(self, other: DispatchKeySet) -> DispatchKeySet
Union of two sets.
Sourcepub fn intersection(self, other: DispatchKeySet) -> DispatchKeySet
pub fn intersection(self, other: DispatchKeySet) -> DispatchKeySet
Intersection of two sets.
Sourcepub fn highest(self) -> Option<DispatchKey>
pub fn highest(self) -> Option<DispatchKey>
Highest-priority key in this set, or None if empty. This
is the “next” key the dispatcher will resolve.
Sourcepub fn iter_desc(self) -> impl Iterator<Item = DispatchKey>
pub fn iter_desc(self) -> impl Iterator<Item = DispatchKey>
Returns an iterator over all keys in the set, in descending priority order (highest first).
Trait Implementations§
Source§impl Clone for DispatchKeySet
impl Clone for DispatchKeySet
Source§fn clone(&self) -> DispatchKeySet
fn clone(&self) -> DispatchKeySet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DispatchKeySet
impl Debug for DispatchKeySet
Source§impl Default for DispatchKeySet
impl Default for DispatchKeySet
Source§fn default() -> DispatchKeySet
fn default() -> DispatchKeySet
Returns the “default value” for a type. Read more
Source§impl<const N: usize> From<[DispatchKey; N]> for DispatchKeySet
impl<const N: usize> From<[DispatchKey; N]> for DispatchKeySet
Source§fn from(arr: [DispatchKey; N]) -> DispatchKeySet
fn from(arr: [DispatchKey; N]) -> DispatchKeySet
Converts to this type from the input type.
Source§impl Hash for DispatchKeySet
impl Hash for DispatchKeySet
Source§impl PartialEq for DispatchKeySet
impl PartialEq for DispatchKeySet
impl Copy for DispatchKeySet
impl Eq for DispatchKeySet
impl StructuralPartialEq for DispatchKeySet
Auto Trait Implementations§
impl Freeze for DispatchKeySet
impl RefUnwindSafe for DispatchKeySet
impl Send for DispatchKeySet
impl Sync for DispatchKeySet
impl Unpin for DispatchKeySet
impl UnsafeUnpin for DispatchKeySet
impl UnwindSafe for DispatchKeySet
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§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().