pub struct Gate { /* private fields */ }Expand description
Input gate.
Pure logic, no clock: the conditions are set by whoever owns them and the latch is driven by the button recognizer’s edges.
Implementations§
Source§impl Gate
impl Gate
pub const fn new() -> Self
Sourcepub fn set(&mut self, reason: GateReason, active: bool)
pub fn set(&mut self, reason: GateReason, active: bool)
Assert or release a condition.
pub fn is_set(&self, reason: GateReason) -> bool
Sourcepub fn on_press(&mut self)
pub fn on_press(&mut self)
Latch the current conditions at the start of a gesture.
Call on every debounced press edge; presses that continue an in-progress chord are ignored, so the first one decides.
Sourcepub fn settle(&mut self, resting: bool)
pub fn settle(&mut self, resting: bool)
Release the latch once the recognizer is at rest.
Pass umsh_ux_tracker::button::ButtonFsm::next_deadline().is_none().
This covers gestures that end without producing an event — a hold
too long to be a click and too short to be a long-press — which
would otherwise strand the latch and swallow the next gesture.
Sourcepub fn disposition(&self, event: ButtonEvent) -> Disposition
pub fn disposition(&self, event: ButtonEvent) -> Disposition
Decide what a resolved gesture means.
Judged against the latched conditions when a gesture is in progress, and against the live ones otherwise.
Trait Implementations§
impl Copy for Gate
Auto Trait Implementations§
impl Freeze for Gate
impl RefUnwindSafe for Gate
impl Send for Gate
impl Sync for Gate
impl Unpin for Gate
impl UnwindSafe for Gate
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)