unsafe trait Erased<'a>: 'a {
// Required method
fn tag_id(&self) -> TypeId;
}
Expand description
Represents a type-erased but identifiable object.
This trait is exclusively implemented by the TaggedOption
type.
Required Methods§
Implementations§
source§impl<'a> dyn Erased<'a> + 'a
impl<'a> dyn Erased<'a> + 'a
sourcefn downcast<I>(&self) -> Option<&TaggedOption<'a, I>>where
I: Type<'a>,
🔬This is a nightly-only experimental API. (provide_any
#96024)
fn downcast<I>(&self) -> Option<&TaggedOption<'a, I>>where I: Type<'a>,
provide_any
#96024)Returns some reference to the dynamic value if it is tagged with I
,
or None
otherwise.
sourcefn downcast_mut<I>(&mut self) -> Option<&mut TaggedOption<'a, I>>where
I: Type<'a>,
🔬This is a nightly-only experimental API. (provide_any
#96024)
fn downcast_mut<I>(&mut self) -> Option<&mut TaggedOption<'a, I>>where I: Type<'a>,
provide_any
#96024)Returns some mutable reference to the dynamic value if it is tagged with I
,
or None
otherwise.