pub struct Options<'a> { /* private fields */ }
Expand description

Options which can be used to configure how a misc device is registered.

Examples

fn example(
    reg: Pin<&mut miscdev::Registration<impl file::Operations<OpenData = ()>>>,
    parent: &dyn RawDevice,
) -> Result {
    miscdev::Options::new()
        .mode(0o600)
        .minor(10)
        .parent(parent)
        .register(reg, fmt!("sample"), ())
}

Implementations

Creates new Options instance with the required fields.

Sets the minor device number.

Sets the device mode.

This is usually an octal number and describes who can perform read/write/execute operations on the device.

Sets the device parent.

Registers a misc device using the configured options.

Allocates a new registration of a misc device and completes the registration with the configured options.

Trait Implementations

Returns the “default value” for a type. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.