pub struct AnyKey(/* private fields */);
Expand description
Type-erased key for the Registry
.
Implementations§
Source§impl AnyKey
impl AnyKey
Sourcepub fn is<K: Any>(&self) -> bool
pub fn is<K: Any>(&self) -> bool
Returns whether the key is of type K
.
Equivalent to self.as_any().is::<K>()
.
Sourcepub fn is_anonymous(&self) -> bool
pub fn is_anonymous(&self) -> bool
Returns whether the key corresponds to an anonymous await-tree.
Sourcepub fn downcast_ref<K: Any>(&self) -> Option<&K>
pub fn downcast_ref<K: Any>(&self) -> Option<&K>
Returns the key as a reference to type K
, if it is of type K
.
Equivalent to self.as_any().downcast_ref::<K>()
.
Trait Implementations§
impl Eq for AnyKey
Auto Trait Implementations§
impl Freeze for AnyKey
impl !RefUnwindSafe for AnyKey
impl Send for AnyKey
impl Sync for AnyKey
impl Unpin for AnyKey
impl !UnwindSafe for AnyKey
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> 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> ToRootSpan for Twhere
T: Display,
impl<T> ToRootSpan for Twhere
T: Display,
Source§fn to_root_span(&self) -> Span
fn to_root_span(&self) -> Span
Convert the type to a
Span
that can be used as the root of an await-tree.