pub enum ToolProblem {
NotStarted(String),
Interrupted(String),
NetworkError {
sent: bool,
reason: String,
},
}Expand description
Why a call got no value back: std’s ToolProblem (errors.md, Tool
problems), which a Tool answers with and also takes or answers as data.
A Tool function returning Result<R, ToolProblem> declares R, and
answers Ok(r) with a value or Err(problem) with one of these. A
domain failure, such as a declined card, is not a ToolProblem: it is a
value of R, which may itself be a Result. The enum is exhaustive: an
author’s match names each case.
Variants§
NotStarted(String)
The work did not begin, and why.
Interrupted(String)
The work began and stopped before a value, and why.
NetworkError
The network to the Tool failed.
Trait Implementations§
Source§impl Clone for ToolProblem
impl Clone for ToolProblem
Source§impl Debug for ToolProblem
impl Debug for ToolProblem
Source§impl Display for ToolProblem
impl Display for ToolProblem
impl Eq for ToolProblem
Source§impl Error for ToolProblem
impl Error for ToolProblem
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ToolProblem> for NoAnswer
impl From<ToolProblem> for NoAnswer
Source§fn from(problem: ToolProblem) -> NoAnswer
fn from(problem: ToolProblem) -> NoAnswer
Converts to this type from the input type.
Source§impl<V> From<ToolProblem> for Outcome<V>
impl<V> From<ToolProblem> for Outcome<V>
Source§fn from(problem: ToolProblem) -> Outcome<V>
fn from(problem: ToolProblem) -> Outcome<V>
Converts to this type from the input type.
Source§impl PartialEq for ToolProblem
impl PartialEq for ToolProblem
Source§impl Shaped for ToolProblem
std’s ToolProblem, its constructors found by name in the enum the
catalog declares.
impl Shaped for ToolProblem
std’s ToolProblem, its constructors found by name in the enum the
catalog declares.
Source§fn write_at(
&self,
out: &mut ValueWriter<'_, '_>,
ty: &Type,
) -> Result<(), EncodeError>
fn write_at( &self, out: &mut ValueWriter<'_, '_>, ty: &Type, ) -> Result<(), EncodeError>
Source§fn read_at(
input: &mut ValueReader<'_, '_, '_>,
ty: &Type,
) -> Result<Self, DecodeError>
fn read_at( input: &mut ValueReader<'_, '_, '_>, ty: &Type, ) -> Result<Self, DecodeError>
impl StructuralPartialEq for ToolProblem
Auto Trait Implementations§
impl Forget for ToolProblem
impl Freeze for ToolProblem
impl Move for ToolProblem
impl RefUnwindSafe for ToolProblem
impl Send for ToolProblemwhere
RawVecInner: Send,
impl Sync for ToolProblemwhere
RawVecInner: Sync,
impl Unpin for ToolProblem
impl UnsafeUnpin for ToolProblem
impl UnwindSafe for ToolProblemwhere
RawVecInner: UnwindSafe,
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