Trait AsAny

Source
pub trait AsAny {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn type_name(&self) -> &'static str;
    fn swap_dyn(&mut self, other: &mut dyn Any) -> bool;
}
Expand description

Allow downcast for trait object.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Source

fn type_name(&self) -> &'static str

Source

fn swap_dyn(&mut self, other: &mut dyn Any) -> bool

Swap 2 values. Returns true if both values had the same type and so the swap was successful.

Implementors§

Source§

impl<T> AsAny for T
where T: Sized + 'static,