pub trait Driver {
type IdInfo: 'static;
const ID_TABLE: IdTable<Self::IdInfo>;
// Required method
fn probe(
dev: &Device<Core>,
id_info: &Self::IdInfo,
) -> impl PinInit<Self, Error>;
// Provided method
fn unbind(dev: &Device<Core>, this: Pin<&Self>) { ... }
}Expand description
The auxiliary driver trait.
Drivers must implement this trait in order to get an auxiliary driver registered.
Required Associated Constants§
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn unbind(dev: &Device<Core>, this: Pin<&Self>)
fn unbind(dev: &Device<Core>, this: Pin<&Self>)
Auxiliary driver unbind.
Called when a Device is unbound from its bound Driver. Implementing this callback
is optional.
This callback serves as a place for drivers to perform teardown operations that require a
&Device<Core> or &Device<Bound> reference. For instance, drivers may try to perform I/O
operations to gracefully tear down the device.
Otherwise, release operations for driver resources should be performed in Self::drop.
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.