pub unsafe trait Raw: Sized {
    type Raw: Sized;
    unsafe fn from_raw(raw: *mut Self::Raw) -> Self;
unsafe fn from_raw_opt(raw: *mut Self::Raw) -> Option<Self>;
fn into_raw(self) -> *mut Self::Raw;
fn as_raw(&self) -> *mut Self::Raw; }
Expand description

Allow conversion to/from raw (winapi) pointer types.

⚠️ Safety ⚠️

Lots of code depends on implicit invariants of this trait for soundness:

Associated Types

The raw underlying winapi type

Required methods

Take ownership from a raw winapi type, panicing if raw is null.

⚠️ Safety ⚠️
  • raw must either be null or a sane/valid instance of the type in question.
Panics
  • If raw is null

Take ownership from a raw winapi type, returning None if raw is null.

⚠️ Safety ⚠️
  • raw must either be null or a sane/valid instance of the type in question.

Give up / leak ownership into a raw winapi pointer type.

Allow access as a raw winapi pointer type.

Implementors