Trait xcb::Raw

source · []
pub trait Raw<T>: Sized {
    unsafe fn from_raw(raw: *mut T) -> Self;
fn as_raw(&self) -> *mut T; fn into_raw(self) -> *mut T { ... } }
Expand description

Trait for types that own a C allocated pointer and are represented by the data pointed to.

Required methods

Build Self from a raw pointer

Safety

raw must be a valid pointer to the representation of Self, and be allocated with libc::malloc

Obtain the raw pointer representation

Provided methods

Convert self into a raw pointer

Returned value should be freed with libc::free or sent back to from_raw to avoid memory leak.

Implementors