[][src]Trait unsafe_any::UnsafeAnyExt

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

An extension trait for unchecked downcasting of trait objects.

Provided methods

unsafe fn downcast_ref_unchecked<T: Any>(&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: Any>(&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: Any>(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!

Loading content...

Implementations on Foreign Types

impl UnsafeAnyExt for dyn Any[src]

unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T[src]

unsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T[src]

unsafe fn downcast_unchecked<T: Any>(self: Box<Self>) -> Box<T>[src]

impl UnsafeAnyExt for dyn Any + Send[src]

unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T[src]

unsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T[src]

unsafe fn downcast_unchecked<T: Any>(self: Box<Self>) -> Box<T>[src]

impl UnsafeAnyExt for dyn Any + Sync[src]

unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T[src]

unsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T[src]

unsafe fn downcast_unchecked<T: Any>(self: Box<Self>) -> Box<T>[src]

impl UnsafeAnyExt for dyn Any + Send + Sync[src]

unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T[src]

unsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T[src]

unsafe fn downcast_unchecked<T: Any>(self: Box<Self>) -> Box<T>[src]

Loading content...

Implementors

impl UnsafeAnyExt for dyn UnsafeAny[src]

unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T[src]

unsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T[src]

unsafe fn downcast_unchecked<T: Any>(self: Box<Self>) -> Box<T>[src]

impl UnsafeAnyExt for dyn UnsafeAny + Send[src]

unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T[src]

unsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T[src]

unsafe fn downcast_unchecked<T: Any>(self: Box<Self>) -> Box<T>[src]

impl UnsafeAnyExt for dyn UnsafeAny + Send + Sync[src]

unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T[src]

unsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T[src]

unsafe fn downcast_unchecked<T: Any>(self: Box<Self>) -> Box<T>[src]

impl UnsafeAnyExt for dyn UnsafeAny + Sync[src]

unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T[src]

unsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T[src]

unsafe fn downcast_unchecked<T: Any>(self: Box<Self>) -> Box<T>[src]

Loading content...