Trait FromRaw

Source
pub trait FromRaw<T> {
    // Required method
    unsafe fn from_raw(ffi: *mut T, context: &Libinput) -> Self;
}
Expand description

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

Required Methods§

Source

unsafe fn from_raw(ffi: *mut T, context: &Libinput) -> Self

Create a new instance of this type from a raw pointer and it’s context. If the type of the struct is a valid libinput type, but is unknown to this library, it panics instead.

§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..

§Safety

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.

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.

Implementors§

Source§

impl FromRaw<libinput_device> for Device

Source§

impl FromRaw<libinput_device_group> for DeviceGroup

Source§

impl FromRaw<libinput_event> for Event

Source§

impl FromRaw<libinput_event_device_notify> for DeviceEvent

Source§

impl FromRaw<libinput_event_device_notify> for DeviceAddedEvent

Source§

impl FromRaw<libinput_event_device_notify> for DeviceRemovedEvent

Source§

impl FromRaw<libinput_event_gesture> for GestureEvent

Source§

impl FromRaw<libinput_event_gesture> for GestureHoldEvent

Source§

impl FromRaw<libinput_event_gesture> for GesturePinchEvent

Source§

impl FromRaw<libinput_event_gesture> for GestureSwipeEvent

Source§

impl FromRaw<libinput_event_gesture> for GestureHoldBeginEvent

Source§

impl FromRaw<libinput_event_gesture> for GestureHoldEndEvent

Source§

impl FromRaw<libinput_event_gesture> for GesturePinchBeginEvent

Source§

impl FromRaw<libinput_event_gesture> for GesturePinchEndEvent

Source§

impl FromRaw<libinput_event_gesture> for GesturePinchUpdateEvent

Source§

impl FromRaw<libinput_event_gesture> for GestureSwipeBeginEvent

Source§

impl FromRaw<libinput_event_gesture> for GestureSwipeEndEvent

Source§

impl FromRaw<libinput_event_gesture> for GestureSwipeUpdateEvent

Source§

impl FromRaw<libinput_event_keyboard> for KeyboardEvent

Source§

impl FromRaw<libinput_event_keyboard> for KeyboardKeyEvent

Source§

impl FromRaw<libinput_event_pointer> for PointerEvent

Source§

impl FromRaw<libinput_event_pointer> for PointerAxisEvent

Source§

impl FromRaw<libinput_event_pointer> for PointerButtonEvent

Source§

impl FromRaw<libinput_event_pointer> for PointerMotionAbsoluteEvent

Source§

impl FromRaw<libinput_event_pointer> for PointerMotionEvent

Source§

impl FromRaw<libinput_event_pointer> for PointerScrollContinuousEvent

Source§

impl FromRaw<libinput_event_pointer> for PointerScrollFingerEvent

Source§

impl FromRaw<libinput_event_pointer> for PointerScrollWheelEvent

Source§

impl FromRaw<libinput_event_switch> for SwitchEvent

Source§

impl FromRaw<libinput_event_switch> for SwitchToggleEvent

Source§

impl FromRaw<libinput_event_tablet_pad> for TabletPadEvent

Source§

impl FromRaw<libinput_event_tablet_pad> for TabletPadButtonEvent

Source§

impl FromRaw<libinput_event_tablet_pad> for TabletPadKeyEvent

Source§

impl FromRaw<libinput_event_tablet_pad> for TabletPadRingEvent

Source§

impl FromRaw<libinput_event_tablet_pad> for TabletPadStripEvent

Source§

impl FromRaw<libinput_event_tablet_tool> for TabletToolEvent

Source§

impl FromRaw<libinput_event_tablet_tool> for TabletToolAxisEvent

Source§

impl FromRaw<libinput_event_tablet_tool> for TabletToolButtonEvent

Source§

impl FromRaw<libinput_event_tablet_tool> for TabletToolProximityEvent

Source§

impl FromRaw<libinput_event_tablet_tool> for TabletToolTipEvent

Source§

impl FromRaw<libinput_event_touch> for TouchEvent

Source§

impl FromRaw<libinput_event_touch> for TouchCancelEvent

Source§

impl FromRaw<libinput_event_touch> for TouchDownEvent

Source§

impl FromRaw<libinput_event_touch> for TouchFrameEvent

Source§

impl FromRaw<libinput_event_touch> for TouchMotionEvent

Source§

impl FromRaw<libinput_event_touch> for TouchUpEvent

Source§

impl FromRaw<libinput_seat> for Seat

Source§

impl FromRaw<libinput_tablet_pad_mode_group> for TabletPadModeGroup

Source§

impl FromRaw<libinput_tablet_tool> for TabletTool