Struct tokio_hidg::StateChange
source · pub struct StateChange<T> { /* private fields */ }
Expand description
Key/button/LED state change event
Implementations§
source§impl<T> StateChange<T>
impl<T> StateChange<T>
sourcepub fn new(data: T, state: bool) -> StateChange<T>
pub fn new(data: T, state: bool) -> StateChange<T>
Create new state change event
sourcepub fn press(data: T) -> StateChange<T>
pub fn press(data: T) -> StateChange<T>
Create new press event
sourcepub fn on(data: T) -> StateChange<T>
pub fn on(data: T) -> StateChange<T>
Create new on event
sourcepub fn release(data: T) -> StateChange<T>
pub fn release(data: T) -> StateChange<T>
Create new release event
sourcepub fn off(data: T) -> StateChange<T>
pub fn off(data: T) -> StateChange<T>
Create new off event
sourcepub fn is_release(&self) -> bool
pub fn is_release(&self) -> bool
Is key/button release event
Trait Implementations§
source§impl<T> Clone for StateChange<T>where
T: Clone,
impl<T> Clone for StateChange<T>where
T: Clone,
source§fn clone(&self) -> StateChange<T>
fn clone(&self) -> StateChange<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T> Debug for StateChange<T>where
T: Debug,
impl<T> Debug for StateChange<T>where
T: Debug,
source§impl<T> Deref for StateChange<T>
impl<T> Deref for StateChange<T>
source§impl<T> DerefMut for StateChange<T>
impl<T> DerefMut for StateChange<T>
source§impl Extend<StateChange<Button>> for MouseInput
impl Extend<StateChange<Button>> for MouseInput
source§fn extend<T>(&mut self, iter: T)
fn extend<T>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl Extend<StateChange<Buttons>> for MouseInput
impl Extend<StateChange<Buttons>> for MouseInput
source§fn extend<T>(&mut self, iter: T)
fn extend<T>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl Extend<StateChange<Key>> for KeyboardInput
impl Extend<StateChange<Key>> for KeyboardInput
source§fn extend<T>(&mut self, iter: T)
fn extend<T>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl Extend<StateChange<Led>> for KeyboardOutput
impl Extend<StateChange<Led>> for KeyboardOutput
source§fn extend<T>(&mut self, iter: T)
fn extend<T>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl Extend<StateChange<Leds>> for KeyboardOutput
impl Extend<StateChange<Leds>> for KeyboardOutput
source§fn extend<T>(&mut self, iter: T)
fn extend<T>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl Extend<StateChange<Modifiers>> for KeyboardInput
impl Extend<StateChange<Modifiers>> for KeyboardInput
source§fn extend<T>(&mut self, iter: T)
fn extend<T>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<T> From<(T, bool)> for StateChange<T>
impl<T> From<(T, bool)> for StateChange<T>
source§fn from(_: (T, bool)) -> StateChange<T>
fn from(_: (T, bool)) -> StateChange<T>
Converts to this type from the input type.
source§impl<T> PartialEq for StateChange<T>where
T: PartialEq,
impl<T> PartialEq for StateChange<T>where
T: PartialEq,
source§fn eq(&self, other: &StateChange<T>) -> bool
fn eq(&self, other: &StateChange<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T> Copy for StateChange<T>where
T: Copy,
impl<T> Eq for StateChange<T>where
T: Eq,
impl<T> StructuralPartialEq for StateChange<T>
Auto Trait Implementations§
impl<T> Freeze for StateChange<T>where
T: Freeze,
impl<T> RefUnwindSafe for StateChange<T>where
T: RefUnwindSafe,
impl<T> Send for StateChange<T>where
T: Send,
impl<T> Sync for StateChange<T>where
T: Sync,
impl<T> Unpin for StateChange<T>where
T: Unpin,
impl<T> UnwindSafe for StateChange<T>where
T: UnwindSafe,
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