[−][src]Trait oxygengine_core::ecs::shred::CastFrom
Helper trait for the MetaTable
.
This trait is required to be implemented for a trait to be compatible with the meta table.
Examples
use shred::CastFrom; trait Foo { fn foo1(&self); fn foo2(&mut self, x: i32) -> i32; } impl<T> CastFrom<T> for Foo where T: Foo + 'static, { fn cast(t: &T) -> &(Foo + 'static) { t } fn cast_mut(t: &mut T) -> &mut (Foo + 'static) { t } }
Required methods
fn cast(t: &T) -> &Self
Casts an immutable T
reference to a trait object.
fn cast_mut(t: &mut T) -> &mut Self
Casts a mutable T
reference to a trait object.
Implementors
impl<T> CastFrom<T> for dyn AnyStorage + 'static where
T: AnyStorage + 'static,
[src]
T: AnyStorage + 'static,