Trait unsafe_any::UnsafeAnyExt [] [src]

pub trait UnsafeAnyExt {
    unsafe fn downcast_ref_unchecked<T: 'static>(&self) -> &T;
    unsafe fn downcast_mut_unchecked<T: 'static>(&mut self) -> &mut T;
    unsafe fn downcast_unchecked<T: 'static>(self: Box<Self>) -> Box<T>;
}

An extension trait for unchecked downcasting of trait objects.

Required Methods

unsafe fn downcast_ref_unchecked<T: 'static>(&self) -> &T

Returns a reference to the contained value, assuming that it is of type T.

Warning

If you are not absolutely certain of T you should not call this!

unsafe fn downcast_mut_unchecked<T: 'static>(&mut self) -> &mut T

Returns a mutable reference to the contained value, assuming that it is of type T.

Warning

If you are not absolutely certain of T you should not call this!

unsafe fn downcast_unchecked<T: 'static>(self: Box<Self>) -> Box<T>

Returns a the contained value, assuming that it is of type T.

Warning

If you are not absolutely certain of T you should not call this!

Implementors