pub enum Input {
Event(Value),
Time {
now: i64,
},
Work {
id: String,
outcome: Outcome,
data: Option<Value>,
},
}Expand description
One input of a chunk.
Variants§
Event(Value)
An event for the root, with its type.
Time
Time moves to now, firing the timers due by then; a now behind
the clock, a negative one among them, leaves it where it is.
Work
Work the run waits for ends. data is Some(Value::Null) for a
null the input carries, and None when it carries none; a result
of done carries none, not even null.
Implementations§
Source§impl Input
impl Input
Sourcepub fn from_json(input: &Value) -> Result<Self, ApplyError>
pub fn from_json(input: &Value) -> Result<Self, ApplyError>
Reads an input from its JSON, as the workflow contract tells inputs
apart: a kind of time or work marks a control input, whatever
else it has, and one with a type is no input; anything else with a
string type is an event. A control input may carry keys it does not
read, but a result of done carries no data, not even null.
Sourcepub fn to_json(&self) -> Value
pub fn to_json(&self) -> Value
The input as JSON, as Input::from_json reads it.
Trait Implementations§
impl StructuralPartialEq for Input
Auto Trait Implementations§
impl Forget for Input
impl Freeze for Inputwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
impl Move for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnsafeUnpin for Inputwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
impl UnwindSafe for Input
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