pub enum TimerEvent {
Key(TimerKey, Option<u64>),
Other(Box<Value>),
}Expand description
A system timer’s event. A machine’s timers ({ type: "xstate.timer", ...key }) keep only their key and build the event when it is delivered
or persisted: a JSON object costs several allocations, and an idle actor
typically has an after timer.
Variants§
Key(TimerKey, Option<u64>)
{ type: "xstate.timer", ...key, occurrence }: the occurrence of
the scheduling, when it has one.
Other(Box<Value>)
Any other event, as it is (boxed: rare).
Implementations§
Source§impl TimerEvent
impl TimerEvent
Sourcepub fn from_value(event: Value) -> Self
pub fn from_value(event: Value) -> Self
Reads a persisted event, typed only when TimerEvent::to_value
writes it back exactly as it is.
Trait Implementations§
Source§impl Clone for TimerEvent
impl Clone for TimerEvent
Source§impl Debug for TimerEvent
impl Debug for TimerEvent
Source§impl PartialEq for TimerEvent
impl PartialEq for TimerEvent
Source§impl Serialize for TimerEvent
impl Serialize for TimerEvent
impl StructuralPartialEq for TimerEvent
Auto Trait Implementations§
impl Forget for TimerEvent
impl Freeze for TimerEvent
impl Move for TimerEvent
impl RefUnwindSafe for TimerEvent
impl Send for TimerEvent
impl Sync for TimerEvent
impl Unpin for TimerEvent
impl UnsafeUnpin for TimerEventwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const Value is !null: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
impl UnwindSafe for TimerEvent
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