pub unsafe trait RegistrationOps {
type RegType: Default;
// Required methods
unsafe fn register(
reg: &Opaque<Self::RegType>,
name: &'static CStr,
module: &'static ThisModule,
) -> Result;
unsafe fn unregister(reg: &Opaque<Self::RegType>);
}Expand description
The RegistrationOps trait serves as generic interface for subsystems (e.g., PCI, Platform,
Amba, etc.) to provide the corresponding subsystem specific implementation to register /
unregister a driver of the particular type (RegType).
For instance, the PCI subsystem would set RegType to bindings::pci_driver and call
bindings::__pci_register_driver from RegistrationOps::register and
bindings::pci_unregister_driver from RegistrationOps::unregister.
§Safety
A call to RegistrationOps::unregister for a given instance of RegType is only valid if a
preceding call to RegistrationOps::register has been successful.
Required Associated Types§
Required Methods§
Sourceunsafe fn register(
reg: &Opaque<Self::RegType>,
name: &'static CStr,
module: &'static ThisModule,
) -> Result
unsafe fn register( reg: &Opaque<Self::RegType>, name: &'static CStr, module: &'static ThisModule, ) -> Result
Registers a driver.
§Safety
On success, reg must remain pinned and valid until the matching call to
RegistrationOps::unregister.
Sourceunsafe fn unregister(reg: &Opaque<Self::RegType>)
unsafe fn unregister(reg: &Opaque<Self::RegType>)
Unregisters a driver previously registered with RegistrationOps::register.
§Safety
Must only be called after a preceding successful call to RegistrationOps::register for
the same reg.
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.