Struct DeviceManager

Source
pub struct DeviceManager<C>{ /* private fields */ }
Expand description

Device Manager manages searching input and output devices and monitoring them.

It packs all the functionality from cognitive-device-manager in in single, easy to use structure.

Implementations§

Source§

impl<C> DeviceManager<C>
where C: 'static + EventHandling + StatePublishing + HwGraphics + Send + Clone,

Source

pub fn new( input_handler: Box<dyn InputHandling>, input_forwarder: Box<dyn InputForwarding>, input_config: InputConfig, coordinator: C, ) -> Self

Constructs new DeviceManager.

Source§

impl<C> DeviceManager<C>
where C: 'static + EventHandling + StatePublishing + HwGraphics + Send + Clone,

Event handlers

Source

pub fn on_suspend(&mut self)

This method is called when application is going to suspend (e.g. virtual terminal was switched).

Source

pub fn on_wakeup(&mut self)

This method is called when application is going to wake up from suspension.

Source

pub fn on_inputs_changed(&mut self)

This method is called when state of one of input devices changed (was added or removed).

Source

pub fn on_outputs_changed(&mut self)

This method is called when state of one of output devices changed (was added or removed).

Auto Trait Implementations§

§

impl<C> Freeze for DeviceManager<C>
where C: Freeze,

§

impl<C> !RefUnwindSafe for DeviceManager<C>

§

impl<C> !Send for DeviceManager<C>

§

impl<C> !Sync for DeviceManager<C>

§

impl<C> Unpin for DeviceManager<C>
where C: Unpin,

§

impl<C> !UnwindSafe for DeviceManager<C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.