Trait Driver

Source
pub trait Driver {
    type IdInfo: 'static;

    const ID_TABLE: IdTable<Self::IdInfo>;

    // Required method
    fn probe(
        dev: &Device<Core>,
        id_info: &Self::IdInfo,
    ) -> Result<Pin<KBox<Self>>>;
}
Expand description

The auxiliary driver trait.

Drivers must implement this trait in order to get an auxiliary driver registered.

Required Associated Constants§

Source

const ID_TABLE: IdTable<Self::IdInfo>

The table of device ids supported by the driver.

Required Associated Types§

Source

type IdInfo: 'static

The type holding information about each device id supported by the driver.

TODO: Use associated_type_defaults once stabilized:

type IdInfo: ’static = ();

Required Methods§

Source

fn probe(dev: &Device<Core>, id_info: &Self::IdInfo) -> Result<Pin<KBox<Self>>>

Auxiliary driver probe.

Called when an auxiliary device is matches a corresponding driver.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§