pub struct ButtonConfig<D = Duration> {
pub debounce: D,
pub release: D,
pub hold: D,
pub mode: Mode,
}
Expand description
Various Button parameters.
Fields§
§debounce: D
How much time the button should be pressed to in order to count it as a press.
release: D
How much time the button should not be held to be released.
hold: D
How much time the button should be pressed to be held.
mode: Mode
Button direction.
Implementations§
Source§impl<D> ButtonConfig<D>
impl<D> ButtonConfig<D>
Sourcepub fn new(debounce: D, release: D, hold: D, mode: Mode) -> Self
pub fn new(debounce: D, release: D, hold: D, mode: Mode) -> Self
Returns new ButtonConfig.
As a general rule, debounce
time is less then release
time and hold
time is larger them both.
Trait Implementations§
Source§impl<D: Clone> Clone for ButtonConfig<D>
impl<D: Clone> Clone for ButtonConfig<D>
Source§fn clone(&self) -> ButtonConfig<D>
fn clone(&self) -> ButtonConfig<D>
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<D: Debug> Debug for ButtonConfig<D>
impl<D: Debug> Debug for ButtonConfig<D>
Source§impl Default for ButtonConfig<Duration>
impl Default for ButtonConfig<Duration>
Source§impl<D: PartialEq> PartialEq for ButtonConfig<D>
impl<D: PartialEq> PartialEq for ButtonConfig<D>
impl<D: Copy> Copy for ButtonConfig<D>
impl<D: Eq> Eq for ButtonConfig<D>
impl<D> StructuralPartialEq for ButtonConfig<D>
Auto Trait Implementations§
impl<D> Freeze for ButtonConfig<D>where
D: Freeze,
impl<D> RefUnwindSafe for ButtonConfig<D>where
D: RefUnwindSafe,
impl<D> Send for ButtonConfig<D>where
D: Send,
impl<D> Sync for ButtonConfig<D>where
D: Sync,
impl<D> Unpin for ButtonConfig<D>where
D: Unpin,
impl<D> UnwindSafe for ButtonConfig<D>where
D: 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