DeviceManager

Trait DeviceManager 

Source
pub trait DeviceManager {
    type DeviceType: Device;
    type Iter<'a>: Iterator<Item = &'a Self::DeviceType>
       where Self: 'a;
    type IterMut<'a>: Iterator<Item = &'a mut Self::DeviceType>
       where Self: 'a;

    // Required methods
    fn init() -> Result<Self>
       where Self: Sized;
    fn deinit(&mut self);
    fn index(&self, index: usize) -> Option<&Self::DeviceType>;
    fn index_mut(&mut self, index: usize) -> Option<&mut Self::DeviceType>;
    fn lookup(&self, id: &str) -> Option<&Self::DeviceType>;
    fn lookup_mut(&mut self, id: &str) -> Option<&mut Self::DeviceType>;
    fn iter(&self) -> Self::Iter<'_>;
    fn iter_mut(&mut self) -> Self::IterMut<'_>;
    fn refresh(&mut self) -> Result<()>;
    fn set_change_handler<F>(&mut self, handler: F) -> Result<()>
       where F: Fn(&DeviceEvent) + Send + Sync + 'static;
}

Required Associated Types§

Source

type DeviceType: Device

Source

type Iter<'a>: Iterator<Item = &'a Self::DeviceType> where Self: 'a

Source

type IterMut<'a>: Iterator<Item = &'a mut Self::DeviceType> where Self: 'a

Required Methods§

Source

fn init() -> Result<Self>
where Self: Sized,

Source

fn deinit(&mut self)

Source

fn index(&self, index: usize) -> Option<&Self::DeviceType>

Source

fn index_mut(&mut self, index: usize) -> Option<&mut Self::DeviceType>

Source

fn lookup(&self, id: &str) -> Option<&Self::DeviceType>

Source

fn lookup_mut(&mut self, id: &str) -> Option<&mut Self::DeviceType>

Source

fn iter(&self) -> Self::Iter<'_>

Source

fn iter_mut(&mut self) -> Self::IterMut<'_>

Source

fn refresh(&mut self) -> Result<()>

Source

fn set_change_handler<F>(&mut self, handler: F) -> Result<()>
where F: Fn(&DeviceEvent) + Send + Sync + 'static,

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.

Implementors§