pub trait Adapter {
type IdInfo: 'static;
// Required method
fn of_id_table() -> Option<IdTable<Self::IdInfo>>;
// Provided methods
fn of_id_info(dev: &Device) -> Option<&'static Self::IdInfo> { ... }
fn id_info(dev: &Device) -> Option<&'static Self::IdInfo> { ... }
}
Expand description
The bus independent adapter to match a drivers and a devices.
This trait should be implemented by the bus specific adapter, which represents the connection of a device and a driver.
It provides bus independent functions for device / driver interactions.
Required Associated Types§
Required Methods§
Sourcefn of_id_table() -> Option<IdTable<Self::IdInfo>>
fn of_id_table() -> Option<IdTable<Self::IdInfo>>
The of::IdTable
of the corresponding driver.
Provided Methods§
Sourcefn of_id_info(dev: &Device) -> Option<&'static Self::IdInfo>
fn of_id_info(dev: &Device) -> Option<&'static Self::IdInfo>
Returns the driver’s private data from the matching entry in the of::IdTable
, if any.
If this returns None
, it means there is no match with an entry in the of::IdTable
.
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.