pub unsafe trait PointerWrapper<N>where
Self: Sized,{
// Required methods
fn wrap(ptr: *mut N) -> Option<Self>;
fn unwrap(self) -> *mut N;
fn inner(&self) -> &N;
fn inner_mut(&mut self) -> &mut N;
}
Expand description
This trait supports the conversion of a wrapper into it’s wrapped C/C++ pointer and back.
The wrapped value can be accessed through the functions inner
and inner_mut
.
§Safety
The native value N
should be treated as opaque, because its definition may change
without adhering to semantic versioning and depends on what the tool bindgen is able to generate.
Converting from a Rust wrapper to the wrapped value loses the automatic ability to free associated resources.
Required Methods§
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.