Skip to main content

Input

Enum Input 

Source
pub enum Input<Ev = Value, D = Value> {
    Event(Ev),
    Control(Control<D>),
}
Expand description

One input: an event of the machine, which has a type, or a control input, which has a kind.

It is read as the workflow contract tells inputs apart, and never as an untagged enum: 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, Ev, a stray kind of it among its own fields ({ "type": "add", "kind": "book" } is an event); and anything else is no input. invalid says why in the words of the contract.

Variants§

§

Event(Ev)

An event for the root.

§

Control(Control<D>)

Time, or the result of work.

Implementations§

Source§

impl<Ev: DeserializeOwned, D: DeserializeOwned> Input<Ev, D>

Source

pub fn from_value(value: Value) -> Result<Self, Error>

Reads an input of its JSON, as invalid tells it: an error that names the rule of what is no input, or the event type’s own error of an event that is not one of Ev.

Trait Implementations§

Source§

impl<Ev: Clone, D: Clone> Clone for Input<Ev, D>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Ev: Debug, D: Debug> Debug for Input<Ev, D>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de, Ev: DeserializeOwned, D: DeserializeOwned> Deserialize<'de> for Input<Ev, D>

Source§

fn deserialize<De: Deserializer<'de>>( deserializer: De, ) -> Result<Self, De::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Ev, D> From<Control<D>> for Input<Ev, D>

Source§

fn from(control: Control<D>) -> Self

Converts to this type from the input type.
Source§

impl<Ev: PartialEq, D: PartialEq> PartialEq for Input<Ev, D>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<Ev: Serialize, D: Serialize> Serialize for Input<Ev, D>

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl<Ev: PartialEq, D: PartialEq> StructuralPartialEq for Input<Ev, D>

Auto Trait Implementations§

§

impl<Ev, D> Forget for Input<Ev, D>

§

impl<Ev, D> Freeze for Input<Ev, D>

§

impl<Ev, D> Move for Input<Ev, D>

§

impl<Ev, D> RefUnwindSafe for Input<Ev, D>

§

impl<Ev, D> Send for Input<Ev, D>
where D: Send, Ev: Send, RawTable<usize>: Send, RawVecInner: Send,

§

impl<Ev, D> Sync for Input<Ev, D>
where D: Sync, Ev: Sync, RawTable<usize>: Sync, RawVecInner: Sync,

§

impl<Ev, D> Unpin for Input<Ev, D>
where D: Unpin, Ev: Unpin, *const u8 is !null: Unpin,

§

impl<Ev, D> UnsafeUnpin for Input<Ev, D>

§

impl<Ev, D> UnwindSafe for Input<Ev, D>
where Ev: UnwindSafe, NonNull<u8>: UnwindSafe, RawVecInner: UnwindSafe, D: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.