unsafe_any

Trait UnsafeAny

Source
pub trait UnsafeAny: Any { }
Expand description

A trait providing unchecked downcasting to its contents when stored in a trait object.

Implementations§

Source§

impl dyn UnsafeAny

Source

pub 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!

Source

pub 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!

Source

pub unsafe fn downcast_unchecked<T: Any>(self: Box<dyn UnsafeAny>) -> 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!

Trait Implementations§

Source§

impl UnsafeAnyExt for dyn UnsafeAny

Source§

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

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

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. Read more
Source§

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

Returns a the contained value, assuming that it is of type T. Read more
Source§

impl UnsafeAnyExt for dyn UnsafeAny + Send

Source§

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

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

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. Read more
Source§

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

Returns a the contained value, assuming that it is of type T. Read more
Source§

impl UnsafeAnyExt for dyn UnsafeAny + Send + Sync

Source§

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

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

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. Read more
Source§

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

Returns a the contained value, assuming that it is of type T. Read more
Source§

impl UnsafeAnyExt for dyn UnsafeAny + Sync

Source§

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

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

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. Read more
Source§

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

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

Implementors§

Source§

impl<T: Any> UnsafeAny for T