Function opaque_pointer::object [−]
pub unsafe fn object<'a, T>(pointer: *const T) -> Result<&'a T, PointerError>
Reference to a object but without back to own it.
That’s the difference with own_back<T>()
, you must
use own_back<T>()
to own it again and it will be dropped.
Errors
The pointer must be not null as it is an obvious invalid pointer.
Safety
Invalid pointer or call it twice could cause an undefined behavior or heap error and a crash.