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_keys<I>(keys: I) -> DispatchKeySetwhere
I: IntoIterator<Item = DispatchKey>,
pub fn from_keys<I>(keys: I) -> DispatchKeySetwhere
I: IntoIterator<Item = DispatchKey>,
Construct a set from an iterable of keys. Convenience wrapper over
the FromIterator impl below for callers that don’t want to chain
.into_iter().collect().
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 (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 DispatchKeySet
Source§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
impl Eq for DispatchKeySet
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 FromIterator<DispatchKey> for DispatchKeySet
impl FromIterator<DispatchKey> for DispatchKeySet
Source§fn from_iter<I>(keys: I) -> DispatchKeySetwhere
I: IntoIterator<Item = DispatchKey>,
fn from_iter<I>(keys: I) -> DispatchKeySetwhere
I: IntoIterator<Item = DispatchKey>,
Creates a value from an iterator. Read more
Source§impl Hash for DispatchKeySet
impl Hash for DispatchKeySet
Source§impl PartialEq for DispatchKeySet
impl PartialEq for DispatchKeySet
Source§fn eq(&self, other: &DispatchKeySet) -> bool
fn eq(&self, other: &DispatchKeySet) -> bool
Tests for
self and other values to be equal, and is used by ==.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<U> AsDistAny for Uwhere
U: 'static,
impl<U> AsDistAny for Uwhere
U: 'static,
Source§fn as_dist_any(&self) -> &(dyn Any + 'static)
fn as_dist_any(&self) -> &(dyn Any + 'static)
Recover the value as
&dyn Any for concrete-type downcasting.impl<T> Boilerplate for T
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§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.impl<T, U> Imply<T> for U
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> 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().