[][src]Trait dyno::Tagged

pub unsafe trait Tagged<'a>: Sealed + 'a {
    pub fn tag_id(&self) -> TypeId;
}

Sealed trait representing a type-erased tagged object.

Required methods

pub fn tag_id(&self) -> TypeId[src]

The TypeId of the Tag this value was tagged with.

Loading content...

Implementations

impl<'a> dyn Tagged<'a>[src]

pub fn tag_ref<I>(value: &I::Type) -> &dyn Tagged<'a> where
    I: Tag<'a>, 
[src]

Tag a reference to a concrete type with a given Tag.

This is like an unsizing coercion, but must be performed explicitly to specify the specific tag.

pub fn tag_mut<I>(value: &mut I::Type) -> &mut dyn Tagged<'a> where
    I: Tag<'a>, 
[src]

Tag a reference to a concrete type with a given Tag.

This is like an unsizing coercion, but must be performed explicitly to specify the specific tag.

pub fn tag_box<I>(value: Box<I::Type>) -> Box<dyn Tagged<'a>> where
    I: Tag<'a>, 
[src]

Tag a Box of a concrete type with a given Tag.

This is like an unsizing coercion, but must be performed explicitly to specify the specific tag.

pub fn is<I>(&self) -> bool where
    I: Tag<'a>, 
[src]

Returns true if the dynamic type is tagged with I.

pub fn downcast_ref<I>(&self) -> Option<&I::Type> where
    I: Tag<'a>, 
[src]

Returns some reference to the dynamic value if it is tagged with I, or None if it isn't.

pub fn downcast_mut<I>(&mut self) -> Option<&mut I::Type> where
    I: Tag<'a>, 
[src]

Returns some reference to the dynamic value if it is tagged with I, or None if it isn't.

pub fn downcast_box<I>(self: Box<Self>) -> Result<Box<I::Type>, Box<Self>> where
    I: Tag<'a>, 
[src]

Implementors

Loading content...