pub enum ApplyError {
Rejected {
rejected: Failure,
},
Fault {
code: String,
message: String,
},
}Expand description
Why a chunk was refused. The actor is then as it was before the chunk. It is one of two things, as the workflow contract tells them apart:
- a rejection,
{ "rejected": { "message", "data"? } }: the run took the chunk and rejected it, as an event the machine failed on or an event to a run that is over; the run goes on as it was, and the contract records the chunk as rejected; - a fault of the runner,
{ "code", "message" }: an input that is no input of the contract (WORKFLOW_INVALID_INPUT), a result of the other kind of work (WORKFLOW_INVALID_WORK_RESULT), or an engine that failed outside a step of the machine and can’t go on (WORKFLOW_ENGINE_FAILED).
The hosts of crate::host give the same fault of what is no chunk: a start
that fails (WORKFLOW_MACHINE_FAILED, or WORKFLOW_INVALID_INPUT of its
options), a snapshot that does not restore (WORKFLOW_INVALID_SNAPSHOT)
and a machine that does not load (WORKFLOW_INVALID_MACHINE, or
WORKFLOW_INVALID_INPUT of its options).
Variants§
Rejected
The run rejected the chunk: the machine failed on an event, or the run takes no event.
Fault
A fault of the runner, of the contract’s code.
Implementations§
Source§impl ApplyError
impl ApplyError
Sourcepub fn invalid_input(message: impl Into<String>) -> Self
pub fn invalid_input(message: impl Into<String>) -> Self
An input that is no input of the contract.
Sourcepub fn invalid_work_result(message: impl Into<String>) -> Self
pub fn invalid_work_result(message: impl Into<String>) -> Self
A work result whose outcome does not fit its work.
Sourcepub fn rejected(message: impl Into<String>) -> Self
pub fn rejected(message: impl Into<String>) -> Self
A chunk the run rejected, of message: the run is over and takes no
event, or the event is one the run never takes.
Sourcepub fn rejected_with(failure: Failure) -> Self
pub fn rejected_with(failure: Failure) -> Self
A chunk the run rejected of failure, as an event the machine failed
on: the root’s error, { "message", "data"? }.
Sourcepub fn start_failed(message: impl Into<String>) -> Self
pub fn start_failed(message: impl Into<String>) -> Self
A start whose root failed, of message, so the run has no state to
go on from: WORKFLOW_MACHINE_FAILED, of no run.
Sourcepub fn invalid_snapshot(message: impl Into<String>) -> Self
pub fn invalid_snapshot(message: impl Into<String>) -> Self
A snapshot a host could not restore a run from, of message:
WORKFLOW_INVALID_SNAPSHOT, of no run.
Sourcepub fn invalid_machine(message: impl Into<String>) -> Self
pub fn invalid_machine(message: impl Into<String>) -> Self
A definition a host could not compile into a machine, of message:
WORKFLOW_INVALID_MACHINE, of no run.
Sourcepub fn engine_failed(message: impl Into<String>) -> Self
pub fn engine_failed(message: impl Into<String>) -> Self
The engine failed outside a step of the machine, as an undo that could not put the run back, so the run can’t go on.
Trait Implementations§
Source§impl Clone for ApplyError
impl Clone for ApplyError
Source§impl Debug for ApplyError
impl Debug for ApplyError
Source§impl<'de> Deserialize<'de> for ApplyError
impl<'de> Deserialize<'de> for ApplyError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ApplyError
impl Display for ApplyError
impl Eq for ApplyError
Source§impl Error for ApplyError
impl Error for ApplyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for ApplyError
impl PartialEq for ApplyError
Source§impl Serialize for ApplyError
impl Serialize for ApplyError
impl StructuralPartialEq for ApplyError
Auto Trait Implementations§
impl Forget for ApplyError
impl Freeze for ApplyErrorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
impl Move for ApplyError
impl RefUnwindSafe for ApplyError
impl Send for ApplyError
impl Sync for ApplyError
impl Unpin for ApplyError
impl UnsafeUnpin for ApplyErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
impl UnwindSafe for ApplyError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.