pub enum Control<D = Value> {
Time {
now: i64,
extra: Map<String, Value>,
},
Work {
id: String,
outcome: Outcome,
data: Option<D>,
extra: Map<String, Value>,
},
}Expand description
A control input: time, or the result of work. It has a kind, and never
a type, so no event of a machine is one, whatever its type.
D is what a result of work carries, any JSON by default. A key the
protocol does not read is kept in extra and written back after the
keys it reads, so a rejected batch or a journal’s chunk holds the input as
it was written.
Variants§
Time
{ "kind": "time", "now" }: moves the run’s clock towards now, in
whole milliseconds, a safe integer of JavaScript, and fires each timer
due by then. A now behind the run’s clock leaves it where it is.
Fields
Work
{ "kind": "work", "id", "outcome", "data"? }: settles work the run
waits for, by its id. data is Some of a null the input
carries, and None of none; a result of done carries none.
Implementations§
Trait Implementations§
Source§impl<'de, D: DeserializeOwned> Deserialize<'de> for Control<D>
impl<'de, D: DeserializeOwned> Deserialize<'de> for Control<D>
Source§fn deserialize<De: Deserializer<'de>>(
deserializer: De,
) -> Result<Self, De::Error>
fn deserialize<De: Deserializer<'de>>( deserializer: De, ) -> Result<Self, De::Error>
Deserialize this value from the given Serde deserializer. Read more
impl<D: PartialEq> StructuralPartialEq for Control<D>
Auto Trait Implementations§
impl<D> Forget for Control<D>
impl<D> Freeze for Control<D>where
*const u8 is !null: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
PhantomData<u8>: Freeze,
D: Freeze,
impl<D> Move for Control<D>
impl<D> RefUnwindSafe for Control<D>where
D: RefUnwindSafe,
impl<D> Send for Control<D>
impl<D> Sync for Control<D>
impl<D> Unpin for Control<D>
impl<D> UnsafeUnpin for Control<D>where
*const u8 is !null: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
D: UnsafeUnpin,
impl<D> UnwindSafe for Control<D>
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