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); }
Expand description

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

Required methods

Get a reference of the underlying struct.

The reference count will not be increased.

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.

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