Trait kernel::auxiliary::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 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 Associated Constants§

source

const ID_TABLE: IdTable<Self::IdInfo>

The table of device ids supported by the driver.

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.

Object Safety§

This trait is not object safe.

Implementors§