Trait unsafe_any::UnsafeAny
source · [−]pub trait UnsafeAny: Any { }
Expand description
A trait providing unchecked downcasting to its contents when stored in a trait object.
Implementations
sourceimpl dyn UnsafeAny
impl dyn UnsafeAny
sourcepub unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T
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!
sourcepub unsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T
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!
Trait Implementations
sourceimpl UnsafeAnyExt for dyn UnsafeAny
impl UnsafeAnyExt for dyn UnsafeAny
sourceunsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T
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
sourceunsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T
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
sourceimpl UnsafeAnyExt for dyn UnsafeAny + Send
impl UnsafeAnyExt for dyn UnsafeAny + Send
sourceunsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T
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
sourceunsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T
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
sourceimpl UnsafeAnyExt for dyn UnsafeAny + Sync
impl UnsafeAnyExt for dyn UnsafeAny + Sync
sourceunsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T
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
sourceunsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T
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
sourceimpl UnsafeAnyExt for dyn UnsafeAny + Send + Sync
impl UnsafeAnyExt for dyn UnsafeAny + Send + Sync
sourceunsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T
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
sourceunsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T
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