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

    // Provided methods
    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§

source

fn state(&self) -> DriverState

source

fn set_state(&mut self, ds: DriverState)

Provided Methods§

source

fn init(&mut self)

Initialize the device DriverState must be Uninitialized

source

fn attach(&mut self)

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

source

fn detach(&mut self)

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

source

fn set_sleep_level(&mut self, level: usize)

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

source

fn destroy(self)

Implementors§