Struct udev::Udev

source · []
pub struct Udev { /* private fields */ }
Expand description

Rust wrapper for the udev struct which represents an opaque libudev context

Most other libudev calls take a struct udev* argument, although whether or not this argument is actually used depends on the version of libudev. In more recent versions the context is ignored, therefore it sometimes works to pass a NULL or a invalid pointer for udev. However older versions, specifically 215 which shipped with Debian 8, expect this to be a valid udev struct. Thus it is not optional.

udev is a ref-counted struct, with references added and removed with udev_ref and udef_unref respectively. This Rust wrapper takes advantage of that ref counting to implement Clone and Drop, so callers need not worry about any C-specific resource management.

Implementations

Creates a new Udev context.

Trait Implementations

Get a reference of the underlying struct. Read more

Convert the object into the underlying pointer. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Executes the destructor for this type. Read more

Create an object from a given raw pointer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.