pub enum TaskError {
NodeError(NodeError),
MissingTransition(String),
MissingNode(String),
TypeError(String),
TaskActive,
NotResumable,
Incomplete,
InvalidState(String),
MissingInput(String),
MissingOutput(String),
NoSteps,
}Expand description
Errors returned while defining, running, or resuming a task.
Variants§
NodeError(NodeError)
A registered node failed while executing.
MissingTransition(String)
A node was executed without an outgoing transition.
MissingNode(String)
A transition referenced a node that does not exist.
TypeError(String)
The task produced a final output with the wrong type.
TaskActive
run was called while the task still had live runtime state.
NotResumable
resume was called without paused or reset work to continue.
Incomplete
The task drained all work without finishing or pausing.
InvalidState(String)
The task runtime detected an internal inconsistency.
MissingInput(String)
A node was executed without the required input.
MissingOutput(String)
A node completed without the expected output.
NoSteps
The task does not have a valid start node and transition graph.
Implementations§
Source§impl TaskError
impl TaskError
Sourcepub fn missing_transition(node_id: usize) -> Self
pub fn missing_transition(node_id: usize) -> Self
Creates a missing-transition error for node_id.
Sourcepub fn missing_node(node_id: usize) -> Self
pub fn missing_node(node_id: usize) -> Self
Creates a missing-node error for node_id.
Sourcepub fn missing_input(node_id: usize) -> Self
pub fn missing_input(node_id: usize) -> Self
Creates a missing-input error for node_id.
Sourcepub fn missing_output(node_id: usize) -> Self
pub fn missing_output(node_id: usize) -> Self
Creates a missing-output error for node_id.
Sourcepub fn type_error<T: Any + Send>(output: &T) -> Self
pub fn type_error<T: Any + Send>(output: &T) -> Self
Creates a type error describing the unexpected final output type.
Sourcepub fn invalid_state(message: impl Into<String>) -> Self
pub fn invalid_state(message: impl Into<String>) -> Self
Creates an invalid-state error with a custom message.
Trait Implementations§
Source§impl Error for TaskError
impl Error for TaskError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for TaskError
impl !UnwindSafe for TaskError
impl Forget for TaskError
impl Freeze for TaskError
impl Send for TaskError
impl Sync for TaskError
impl Unpin for TaskError
impl UnsafeUnpin for TaskError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more