pub trait DriverControl: Sized {
    fn state(&self) -> DriverState;
    fn set_state(&mut self, ds: DriverState);

    fn init(&mut self) { ... }
    fn attach(&mut self) { ... }
    fn detach(&mut self) { ... }
    fn set_sleep_level(&mut self, level: usize) { ... }
    fn destroy(self) { ... }
}
Expand description

Driver life-cycle management trait

Required Methods

Provided Methods

Initialize the device DriverState must be Uninitialized

Attach the driver to the device (claim ownership) DriverState must be Initialized, Detached or Attached(x)

Detach the driver from the device DriverState must be Detached, Attached(x)

Detach the driver from the device DriverState must be Detached, Attached(x)

Implementors