Struct button_driver::config::ButtonConfig
source · pub struct ButtonConfig<D = Duration> {
pub debounce: D,
pub release: D,
pub hold: D,
pub mode: Mode,
}Expand description
Various [Button] parameters.
Fields§
§debounce: DHow much time the button should be pressed to in order to count it as a press.
release: DHow much time the button should not be holed to be released.
hold: DHow much time the button should be pressed to be held.
mode: ModeButton 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>
source§fn eq(&self, other: &ButtonConfig<D>) -> bool
fn eq(&self, other: &ButtonConfig<D>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.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