Trait input::FromRaw

source ·
pub trait FromRaw<T> {
    unsafe fn from_raw(_: *mut T, context: &Libinput) -> Self;
}
Expand description

Trait for types that allow to be initialized from a raw pointer

Required Methods

Create a new instance of this type from a raw pointer and it’s context.

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.

Implementors