pub struct VirtualDevice { /* private fields */ }
Implementations§
Source§impl VirtualDevice
impl VirtualDevice
pub fn create<I>(
id: DeviceId,
name: &str,
event_bits: I,
) -> Result<Self, DeviceCreateError>where
I: IntoIterator<Item = EventBit>,
pub fn path(&self) -> Result<PathBuf, Error>
pub fn poll_force_feedback( &self, timeout: Option<Duration>, ) -> Result<Option<ForceFeedbackRequest<'_>>, Error>
Sourcepub fn emit<T>(&self, body: T) -> Result<(), Error>where
T: AsRef<InputEventBody>,
pub fn emit<T>(&self, body: T) -> Result<(), Error>where
T: AsRef<InputEventBody>,
Emits an event into the device.
You can also pass a whole InputEvent
here, however
the timestamp will be ignored.
The events are buffered and will not be sent immediately;
you need to send InputEventBody::Flush
to flush them.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VirtualDevice
impl RefUnwindSafe for VirtualDevice
impl Send for VirtualDevice
impl Sync for VirtualDevice
impl Unpin for VirtualDevice
impl UnwindSafe for VirtualDevice
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