Trait gbm::FromRaw
[−]
[src]
pub trait FromRaw<T> { unsafe fn from_raw(_: *mut T) -> Self; }
Trait for types that allow to be initialized from a raw pointer
Required Methods
unsafe fn from_raw(_: *mut T) -> Self
Create a new instance of this type from a raw pointer.
Warning
If you make use of Userdata
make sure you use the correct types
to allow receiving the set userdata. When dealing with raw pointers initialized by other
libraries this must be done extra carefully to select a correct representation.
If unsure using ()
is always a safe option.
Unsafety
If the pointer is pointing to a different struct, invalid memory or NULL
the returned
struct may panic on use or cause other undefined behavior.
Effectively cloning objects by using as_raw
and from_raw
is also unsafe as
a double free may occur.
Implementors
impl<'a> FromRaw<gbm_device> for Device<'a>
impl<'a, T: 'static> FromRaw<gbm_bo> for BufferObject<'a, T>
impl<'a, T: 'static> FromRaw<gbm_surface> for Surface<'a, T>