pub trait PtrWrapper: Sized {
    type Pointer;

    unsafe fn from_raw(raw: *mut Self::Pointer) -> Self;
    fn as_ptr(&self) -> *const Self::Pointer;

    fn into_raw(self) -> *mut Self::Pointer { ... }
    fn as_ptr_mut(&mut self) -> *mut Self::Pointer { ... }
}

Required Associated Types

Required Methods

Wraps the pointer into a owned wrapper.

Safety

Pointer must be valid.

Returns the inner pointer.

Provided Methods

Consumes the wrapper and transfers ownershop to the pointer

This does NOT drop the wrapper internally.

Returns the inner pointer (mutable version).

Implementors