Expand description
This module defines types and interfaces that drivers use to interact with the core of DrMem.
Structs
- 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.
Enums
- Defines the requests that can be sent to core. Drivers don’t use this type directly. They are indirectly used by
RequestChan
.
Traits
- All drivers implement the
driver::API
trait.
Type Definitions
- Represents how configuration information is given to a driver. Since each driver can have vastly different requirements, the config structure needs to be as general as possible. A
DriverConfig
type is a map withString
keys andtoml::Value
values. - Defines a boxed type that supports the
driver::API
trait. - A function that drivers use to report updated values of a device.
- Used by a driver to receive settings from a client.
- A closure type that defines how a driver replies to a setting request. It can return
Ok()
to show what value was actually used orErr()
to indicate the setting failed. - This type represents the data that is transferred in the communication channel. It simplifies the next two types.
- The driver is given a stream that yields setting requests. If the driver uses a type that can be converted to and from a
device::Value
, this stream will automatically reject settings that aren’t of the correct type and pass on converted values. - Used by client APIs to send setting requests to a driver.