pub struct RequestChan { /* private fields */ }
Expand description

A handle which is used to communicate with the core of DrMem. When a driver is created, it will be given a handle to be used throughout its life.

This type wraps the mpsc::Sender<> and defines a set of helper methods to send requests and receive replies with the core.

Implementations§

Registers a read-only device with the framework. name is the last section of the full device name. Typically a driver will register several devices, each representing a portion of the hardware being controlled. All devices for a given driver instance will have the same prefix; the name parameter is appended to it.

If it returns Ok(), the value is a broadcast channel that the driver uses to announce new values of the associated hardware.

If it returns Err(), the underlying value could be InUse, meaning the device name is already registered. If the error is InternalError, then the core has exited and the RequestChan has been closed. Since the driver can’t report any more updates, it may as well shutdown.

Registers a read-write device with the framework. name is the last section of the full device name. Typically a driver will register several devices, each representing a portion of the hardware being controlled. All devices for a given driver instance will have the same prefix; the name parameter is appended to it.

If it returns Ok(), the value is a pair containing a broadcast channel that the driver uses to announce new values of the associated hardware and a receive channel for incoming settings to be applied to the hardware.

If it returns Err(), the underlying value could be InUse, meaning the device name is already registered. If the error is InternalError, then the core has exited and the RequestChan has been closed. Since the driver can’t report any more updates or accept new settings, it may as well shutdown.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. 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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.