Skip to main content

AnyComponent

Trait AnyComponent 

Source
pub trait AnyComponent: ErasedComponent {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn as_any_mut(&mut self) -> &mut dyn Any;
}
Expand description

Dyn-safe downcast surface. No blanket impl — Box<dyn AnyComponent> would otherwise shadow per-type vtables. bb::Concrete derive emits the impl.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Downcast view - immutable.

Source

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

Downcast view - mutable.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§