Trait libcamera::utils::UniquePtrTarget

source ·
pub trait UniquePtrTarget: Sized {
    // Required methods
    unsafe fn ptr_new() -> *mut Self;
    unsafe fn ptr_drop(ptr: *mut Self);
}
Expand description

Trait, which allows type to be used in UniquePtr

Required Methods§

source

unsafe fn ptr_new() -> *mut Self

Allocates Self in the heap and returns pointer.

§Safety

Pointer must be deallocated by calling Self::ptr_drop() when no longer needed.

source

unsafe fn ptr_drop(ptr: *mut Self)

Destroys pointer allocated in ptr_new().

§Safety

Pointer must have been created by Self::ptr_new() and is no longer aliased.

Object Safety§

This trait is not object safe.

Implementors§