pub trait Adapter {
type IdInfo: 'static;
// Required methods
fn acpi_id_table() -> Option<IdTable<Self::IdInfo>>;
fn of_id_table() -> Option<IdTable<Self::IdInfo>>;
// Provided method
unsafe 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 acpi_id_table() -> Option<IdTable<Self::IdInfo>>
fn acpi_id_table() -> Option<IdTable<Self::IdInfo>>
The acpi::IdTable of the corresponding driver
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§
Sourceunsafe fn id_info(dev: &Device) -> Option<&'static Self::IdInfo>
unsafe fn id_info(dev: &Device) -> Option<&'static Self::IdInfo>
Returns the driver’s private data from the matching entry of any of the ID tables, if any.
If this returns None, it means that there is no match in any of the ID tables directly
associated with a device::Device.
§Safety
The caller must ensure that the dev matched data is of type Self::IdInfo.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".