pub struct StepContext {
pub now_tsc: u64,
pub timeouts: TimeoutConfig,
}Expand description
Context passed to state machine step functions.
Contains timing information and configuration needed by all state machines.
Fields§
§now_tsc: u64Current TSC value
timeouts: TimeoutConfigTimeout configuration
Implementations§
Source§impl StepContext
impl StepContext
Sourcepub fn now(&self) -> TscTimestamp
pub fn now(&self) -> TscTimestamp
Create timestamp for current time.
Sourcepub fn is_expired(&self, start: TscTimestamp, timeout_ticks: u64) -> bool
pub fn is_expired(&self, start: TscTimestamp, timeout_ticks: u64) -> bool
Check if timeout has elapsed since start.
Trait Implementations§
Source§impl Clone for StepContext
impl Clone for StepContext
Source§fn clone(&self) -> StepContext
fn clone(&self) -> StepContext
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 StepContext
impl Debug for StepContext
impl Copy for StepContext
Auto Trait Implementations§
impl Freeze for StepContext
impl RefUnwindSafe for StepContext
impl Send for StepContext
impl Sync for StepContext
impl Unpin for StepContext
impl UnwindSafe for StepContext
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