kernel::driver::interface

Trait DeviceDriver

Source
pub trait DeviceDriver {
    // Required method
    fn compatible(&self) -> &'static str;

    // Provided method
    unsafe fn init(&self) -> Result<(), &'static str> { ... }
}
Expand description

Device Driver function.

Required Methods§

Source

fn compatible(&self) -> &'static str

Return a compatibility string for identifying the driver.

Provided Methods§

Source

unsafe fn init(&self) -> Result<(), &'static str>

Called by the kernel to bring up the device.

§Safety
  • During init, drivers might do stuff with system-wide impact.

Implementors§