Trait AsAny

Source
pub trait AsAny: Any {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn as_mut_any(&mut self) -> &mut dyn Any;
    fn into_any(self: Box<Self>) -> Box<dyn Any>;
}
Expand description

Trait used for casting support into the Any trait object

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Converts reference to Any

Source

fn as_mut_any(&mut self) -> &mut dyn Any

Converts mutable reference to Any

Source

fn into_any(self: Box<Self>) -> Box<dyn Any>

Consumes and produces Box<dyn Any>

Implementors§

Source§

impl<T: 'static> AsAny for T

Blanket implementation that enables any 'static reference to convert to the Any type