Instance

Trait Instance 

Source
pub trait Instance<'ty>:
    TypedObj
    + Send
    + Sync {
    // Required methods
    fn name(&self) -> SmolStr;
    fn as_inst(&self) -> &(dyn Instance<'ty> + 'ty);
}
Expand description

Any reflected type

Required Methods§

Source

fn name(&self) -> SmolStr

Returns the name of a instance

Source

fn as_inst(&self) -> &(dyn Instance<'ty> + 'ty)

Implementations§

Source§

impl<'ty> dyn Instance<'ty> + 'ty

Source

pub fn downcast_ref<'val, 't, T: Typed<'ty> + 'ty>( &'val self, ) -> Option<&'val T>
where 'ty: 'val,

Downcasts to a concere type

Trait Implementations§

Source§

impl<'ty> DowncastExt<'ty> for Box<dyn Instance<'ty> + 'ty>

Source§

fn downcast<T: Typed<'ty> + 'ty>(self) -> Option<Box<T>>

Downcasts to a boxed concrete type

Implementations on Foreign Types§

Source§

impl<'a, T: Typed<'a> + Clone + PartialEq + 'a> Instance<'a> for Vec<T>

Source§

fn name(&self) -> SmolStr

Source§

fn as_inst(&self) -> &(dyn Instance<'a> + 'a)

Source§

impl<'s> Instance<'s> for String

Source§

fn name(&self) -> SmolStr

Source§

fn as_inst(&self) -> &(dyn Instance<'s> + 's)

Source§

impl<'ty, T: Typed<'ty> + Clone + 'ty> Instance<'ty> for Option<T>

Source§

fn name(&self) -> SmolStr

Source§

fn as_inst(&self) -> &(dyn Instance<'ty> + 'ty)

Implementors§

Source§

impl<'s> Instance<'s> for Bytes