Skip to main content

TimedStep

Struct TimedStep 

Source
pub struct TimedStep<'a, A> {
    pub expired: Option<Vec<KeyInput>>,
    pub step: Step<'a, A>,
}
Expand description

The result of a single TimedPending::feed call.

This is an exhaustive struct — adding a field is a breaking change, chosen deliberately so the compiler catches unhandled cases (the same design principle behind Match and Step being exhaustive enums). The #[must_use] attribute ensures the caller cannot silently discard it.

§Exhaustiveness regression test

The following doctest destructures TimedStep without .. so that adding a new field causes a compile error — making any future field addition a self-aware, visible breaking change:

use keymap_seq::TimedStep;
use keymap_seq::Step;

fn handle<A>(ts: TimedStep<'_, A>) {
    // Destructure every field — no `..` — so a future field addition
    // is a compile error (exhaustiveness regression test).
    let TimedStep { expired, step } = ts;
    let _ = expired;
    let _ = step;
}

Fields§

§expired: Option<Vec<KeyInput>>

Keys from the buffer that was discarded because the inter-key gap exceeded the window. When Some, the Vec is guaranteed non-empty. None means the previous key (if any) arrived within the window.

§step: Step<'a, A>

The outcome of processing the new key after the expiry check.

Trait Implementations§

Source§

impl<'a, A: Debug> Debug for TimedStep<'a, A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, A> Freeze for TimedStep<'a, A>

§

impl<'a, A> RefUnwindSafe for TimedStep<'a, A>
where A: RefUnwindSafe,

§

impl<'a, A> Send for TimedStep<'a, A>
where A: Sync,

§

impl<'a, A> Sync for TimedStep<'a, A>
where A: Sync,

§

impl<'a, A> Unpin for TimedStep<'a, A>

§

impl<'a, A> UnsafeUnpin for TimedStep<'a, A>

§

impl<'a, A> UnwindSafe for TimedStep<'a, A>
where A: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.