Trait udev::AsRawWithContext[][src]

pub trait AsRawWithContext<T: 'static> {
    fn as_raw(&self) -> *mut T;
fn udev(&self) -> &Udev;
fn into_raw_with_context(self) -> (*mut udev, *mut T); }
[]

Receive the underlying raw pointer for types with an associated udev struct which must outlive them.

Required methods

fn as_raw(&self) -> *mut T[src][]

Get a reference of the underlying struct.

The reference count will not be increased.

fn udev(&self) -> &Udev[src][]

The udev context with which this struct was created. This must live at least as long as the struct itself or undefined behavior will result.

fn into_raw_with_context(self) -> (*mut udev, *mut T)[src][]

Convert the object into the raw udev pointer and the underlying pointer for this object.

You are responsible for freeing both. You’re also responsible for ensuring that the udev pointer is not freed until after this object’s pointer is freed.

Implementors

impl AsRawWithContext<udev_device> for Device[src][+]

impl AsRawWithContext<udev_enumerate> for Enumerator[src][+]

impl AsRawWithContext<udev_monitor> for Builder[src][+]