pub trait RawBorrowMut<T> {
// Required method
unsafe fn raw_borrow_mut<'a>(
input: *mut T,
) -> Result<&'a mut Self, UnexpectedNullPointerError>;
}Expand description
Trait to create mutable borrowed references to type T, from a raw pointer to a T. Note that this is implemented for all types.
Required Methods§
Sourceunsafe fn raw_borrow_mut<'a>(
input: *mut T,
) -> Result<&'a mut Self, UnexpectedNullPointerError>
unsafe fn raw_borrow_mut<'a>( input: *mut T, ) -> Result<&'a mut Self, UnexpectedNullPointerError>
Get a mutable reference on the value behind the pointer or return an error if the pointer is
null.
§Safety
As this is using *mut T:as_ref() this is unsafe for exactly the same reasons.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl<T> RawBorrowMut<T> for T
Trait that allows obtaining a mutable borrowed reference to a type T from a raw pointer to T