pub struct HidManager { /* private fields */ }Expand description
Collects HID reports from the platform backends.
Poll-and-drain like the sensor and gamepad managers, for the same reason: a device can report faster than the frame rate, and a callback per report would swamp an app that only wants this frame’s state.
Implementations§
Source§impl HidManager
impl HidManager
pub fn new() -> Self
Sourcepub fn set_devices(&mut self, devices: Vec<HidDevice>)
pub fn set_devices(&mut self, devices: Vec<HidDevice>)
Replace the enumerated device list. Called by the backend at startup and on hotplug.
Sourcepub fn push_report(&mut self, report: HidReport)
pub fn push_report(&mut self, report: HidReport)
Queue an input report.
Sourcepub fn reports(&self) -> &[HidReport]
pub fn reports(&self) -> &[HidReport]
Read the queued reports without consuming them — what a callback does while the event is being dispatched.
Sourcepub fn take_reports(&mut self) -> Vec<HidReport>
pub fn take_reports(&mut self) -> Vec<HidReport>
Drain the queue.
Trait Implementations§
Source§impl Clone for HidManager
impl Clone for HidManager
Source§fn clone(&self) -> HidManager
fn clone(&self) -> HidManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HidManager
impl Debug for HidManager
Source§impl Default for HidManager
impl Default for HidManager
Source§fn default() -> HidManager
fn default() -> HidManager
Returns the “default value” for a type. Read more
impl Eq for HidManager
Source§impl PartialEq for HidManager
impl PartialEq for HidManager
impl StructuralPartialEq for HidManager
Auto Trait Implementations§
impl Freeze for HidManager
impl RefUnwindSafe for HidManager
impl Send for HidManager
impl Sync for HidManager
impl Unpin for HidManager
impl UnsafeUnpin for HidManager
impl UnwindSafe for HidManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more