Trait kernel::driver::DriverLayout
source · pub unsafe trait DriverLayout {
type DriverType: Default;
type DriverData;
const DEVICE_DRIVER_OFFSET: usize;
}Expand description
Trait describing the layout of a specific device driver.
This trait describes the layout of a specific driver structure, such as struct pci_driver or
struct platform_driver.
§Safety
Implementors must guarantee that:
DriverTypeisrepr(C),DriverDatais the type of the driver’s device private data.DriverTypeembeds a validstruct device_driverat byte offsetDEVICE_DRIVER_OFFSET.
Required Associated Types§
sourcetype DriverType: Default
type DriverType: Default
The specific driver type embedding a struct device_driver.
sourcetype DriverData
type DriverData
The type of the driver’s device private data.
Required Associated Constants§
sourceconst DEVICE_DRIVER_OFFSET: usize
const DEVICE_DRIVER_OFFSET: usize
Byte offset of the embedded struct device_driver within DriverType.
This must correspond exactly to the location of the embedded struct device_driver field.
Object Safety§
This trait is not object safe.