Struct gilrs::ev::state::ButtonData
source · pub struct ButtonData {
last_event_ts: SystemTime,
counter: u64,
value: f32,
is_pressed: bool,
is_repeating: bool,
}
Expand description
Information about button stored in State
.
Fields§
§last_event_ts: SystemTime
§counter: u64
§value: f32
§is_pressed: bool
§is_repeating: bool
Implementations§
source§impl ButtonData
impl ButtonData
pub(crate) fn new( value: f32, pressed: bool, repeating: bool, counter: u64, time: SystemTime, ) -> Self
sourcepub fn is_pressed(&self) -> bool
pub fn is_pressed(&self) -> bool
Returns true
if button is pressed.
sourcepub fn is_repeating(&self) -> bool
pub fn is_repeating(&self) -> bool
Returns true
if button is repeating.
sourcepub fn timestamp(&self) -> SystemTime
pub fn timestamp(&self) -> SystemTime
Returns when button state last changed.
Trait Implementations§
source§impl Clone for ButtonData
impl Clone for ButtonData
source§fn clone(&self) -> ButtonData
fn clone(&self) -> ButtonData
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 Debug for ButtonData
impl Debug for ButtonData
impl Copy for ButtonData
Auto Trait Implementations§
impl Freeze for ButtonData
impl RefUnwindSafe for ButtonData
impl Send for ButtonData
impl Sync for ButtonData
impl Unpin for ButtonData
impl UnwindSafe for ButtonData
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