Trait ffi_convert::RawBorrow
source · pub trait RawBorrow<T> {
// Required method
unsafe fn raw_borrow<'a>(
input: *const T
) -> Result<&'a Self, UnexpectedNullPointerError>;
}
Expand description
Trait to create 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<'a>(
input: *const T
) -> Result<&'a Self, UnexpectedNullPointerError>
unsafe fn raw_borrow<'a>( input: *const T ) -> Result<&'a Self, UnexpectedNullPointerError>
Get a reference on the value behind the pointer or return an error if the pointer is null
.
Safety
As this is using *const T::as_ref()
this is unsafe for exactly the same reasons.