#[repr(C, align(8))]pub struct Erased { /* private fields */ }Implementations§
Source§impl Erased
impl Erased
Sourcepub fn new<T>(t: T) -> Self
pub fn new<T>(t: T) -> Self
Create an Erased from a T
T’s destructor cannot be run, as the type is erased.
Sourcepub unsafe fn as_ptr<T>(&self) -> *const T
pub unsafe fn as_ptr<T>(&self) -> *const T
Get a pointer to the contained T.
Unsafe because we don’t know that this is the same T that this Erased was created with.
Sourcepub unsafe fn as_ref<T>(&self) -> &T
pub unsafe fn as_ref<T>(&self) -> &T
Get a reference to the contained T.
Unsafe because we don’t know that this is the same T that this Erased was created with.
Sourcepub unsafe fn as_mut_ptr<T>(&mut self) -> *mut T
pub unsafe fn as_mut_ptr<T>(&mut self) -> *mut T
Get a mutable pointer to the contained T.
Unsafe because we don’t know that this is the same T that this Erased was created with.
Sourcepub unsafe fn as_mut_ref<T>(&mut self) -> &mut T
pub unsafe fn as_mut_ref<T>(&mut self) -> &mut T
Get a mutable reference to the contained T.
Unsafe because we don’t know that this is the same T that this Erased was created with.
Sourcepub unsafe fn get<T: Copy>(&self) -> T
pub unsafe fn get<T: Copy>(&self) -> T
Copy the contained T.
Unsafe because we don’t know that this is the same T that this Erased was created with.
Sourcepub unsafe fn into_inner<T>(self) -> T
pub unsafe fn into_inner<T>(self) -> T
Get the contained T.
Unsafe because we don’t know that this is the same T that this Erased was created with.
Sourcepub unsafe fn into_trident<T>(self) -> Trident<T>
pub unsafe fn into_trident<T>(self) -> Trident<T>
Convert to a Trident<T>
Unsafe because we don’t know that this is the same T that this Erased was created with.