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§
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<()>
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.