pub struct TerminalError(/* private fields */);Expand description
Error representing the result of an operation recorded in the journal.
When returned inside a crate::context::ContextSideEffects::run closure, or in a handler, it completes the operation with a failure value.
Implementations§
Source§impl TerminalError
impl TerminalError
Sourcepub fn new(message: impl Into<String>) -> Self
pub fn new(message: impl Into<String>) -> Self
Create a new TerminalError.
Sourcepub fn new_with_code(code: u16, message: impl Into<String>) -> Self
pub fn new_with_code(code: u16, message: impl Into<String>) -> Self
Create a new TerminalError with a status code.
pub fn code(&self) -> u16
pub fn message(&self) -> &str
pub fn from_error<E: StdError>(e: E) -> Self
Trait Implementations§
Source§impl AsRef<dyn Error> for TerminalError
impl AsRef<dyn Error> for TerminalError
Source§impl Clone for TerminalError
impl Clone for TerminalError
Source§fn clone(&self) -> TerminalError
fn clone(&self) -> TerminalError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TerminalError
impl Debug for TerminalError
Source§impl Display for TerminalError
impl Display for TerminalError
Source§impl From<TerminalError> for HandlerError
impl From<TerminalError> for HandlerError
Source§fn from(value: TerminalError) -> Self
fn from(value: TerminalError) -> Self
Converts to this type from the input type.
Source§impl From<TerminalError> for TerminalFailure
impl From<TerminalError> for TerminalFailure
Source§fn from(value: TerminalError) -> Self
fn from(value: TerminalError) -> Self
Converts to this type from the input type.
Source§impl From<TerminalFailure> for TerminalError
impl From<TerminalFailure> for TerminalError
Source§fn from(value: TerminalFailure) -> Self
fn from(value: TerminalFailure) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TerminalError
impl RefUnwindSafe for TerminalError
impl Send for TerminalError
impl Sync for TerminalError
impl Unpin for TerminalError
impl UnwindSafe for TerminalError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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