#[non_exhaustive]pub struct CallbackError { /* private fields */ }Expand description
Error from a callback operation.
Follows the graded external/internal split: external errors are
caused by the caller’s system (timeout, invalid data), and internal
errors are SDK or service failures. For an
ExternalFailure, the wire
record is reachable through the error’s
source() (a ReplayedFailure) and
through OperationError::wire. From create_callback, it keeps
the callback record’s error type, error data and stack trace. From
wait_for_callback, it has the type Callback.ExternalFailure and
keeps the callback record’s error data. Both keep a nonempty message
and otherwise use Callback failed.
§Examples
use aws_durable_execution_sdk::{CallbackError, CallbackErrorKind};
fn describe(err: &CallbackError) -> String {
match err.kind() {
CallbackErrorKind::TimedOut { .. } => "timed out".to_owned(),
// The failure record travels on `source()`. Its type is the
// external caller's from `create_callback`, and
// `Callback.ExternalFailure` from `wait_for_callback`.
CallbackErrorKind::ExternalFailure { .. } => format!("{err:#}"),
_ => format!("{err:#}"),
}
}Implementations§
Source§impl CallbackError
impl CallbackError
Sourcepub fn kind(&self) -> &CallbackErrorKind
pub fn kind(&self) -> &CallbackErrorKind
Returns the specific kind of callback error.
Trait Implementations§
Source§impl Debug for CallbackError
impl Debug for CallbackError
Source§impl Display for CallbackError
impl Display for CallbackError
Source§impl Error for CallbackError
impl Error for CallbackError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for CallbackError
impl !UnwindSafe for CallbackError
impl Forget for CallbackError
impl Freeze for CallbackError
impl Move for CallbackError
impl Send for CallbackError
impl Sync for CallbackError
impl Unpin for CallbackError
impl UnsafeUnpin for CallbackError
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> 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 moreCreates a shared type from an unshared type.