pub struct ApplicationFailure { /* private fields */ }Expand description
User-authored application failure metadata that can be converted into a Temporal failure.
Implementations§
Source§impl ApplicationFailure
impl ApplicationFailure
Sourcepub fn builder(source: impl Into<Error>) -> ApplicationFailureBuilder
pub fn builder(source: impl Into<Error>) -> ApplicationFailureBuilder
Create an instance of ApplicationFailure using the builder syntax
Source§impl ApplicationFailure
impl ApplicationFailure
Sourcepub fn new(source: impl Into<Error>) -> Self
pub fn new(source: impl Into<Error>) -> Self
Construct a retryable application failure with no extra metadata.
Sourcepub fn non_retryable(source: impl Into<Error>) -> Self
pub fn non_retryable(source: impl Into<Error>) -> Self
Construct a non-retryable application failure with no extra metadata.
Sourcepub fn source_error(&self) -> &Error
pub fn source_error(&self) -> &Error
Returns the wrapped source error.
Sourcepub fn type_name(&self) -> Option<&str>
pub fn type_name(&self) -> Option<&str>
Returns the configured application failure type name, if any.
Sourcepub fn is_non_retryable(&self) -> bool
pub fn is_non_retryable(&self) -> bool
Returns true if this failure should be treated as non-retryable.
Sourcepub fn next_retry_delay(&self) -> Option<Duration>
pub fn next_retry_delay(&self) -> Option<Duration>
Returns the explicitly configured next retry delay, if any.
Sourcepub fn category(&self) -> ApplicationErrorCategory
pub fn category(&self) -> ApplicationErrorCategory
Returns the application error category.
Sourcepub fn details<T: TemporalDeserializable + 'static>(
&self,
) -> Result<Option<T>, PayloadConversionError>
pub fn details<T: TemporalDeserializable + 'static>( &self, ) -> Result<Option<T>, PayloadConversionError>
Returns the decoded details deserialized as the requested type, if any.
Sourcepub fn raw_details(&self) -> Option<&[Payload]>
pub fn raw_details(&self) -> Option<&[Payload]>
Returns the raw decoded details payloads, if any.
Sourcepub fn failure(&self) -> Option<&Failure>
pub fn failure(&self) -> Option<&Failure>
Returns the original failure proto when this application failure was decoded from one.
Sourcepub fn into_failure(self) -> Option<Failure>
pub fn into_failure(self) -> Option<Failure>
Consumes this application failure and returns the retained proto failure, if one exists.
Sourcepub fn cause(&self) -> Option<&IncomingError>
pub fn cause(&self) -> Option<&IncomingError>
Returns the normalized cause, if any.
Sourcepub fn as_timeout(&self) -> Option<&TimeoutError>
pub fn as_timeout(&self) -> Option<&TimeoutError>
If this ApplicationFailure was caused by a timeout, returns the associated
TimeoutError.
Sourcepub fn as_cancelled(&self) -> Option<&CancelledError>
pub fn as_cancelled(&self) -> Option<&CancelledError>
If this ApplicationFailure was caused by a cancellation, returns the associated
CancelledError.
Trait Implementations§
Source§impl Debug for ApplicationFailure
impl Debug for ApplicationFailure
Source§impl Display for ApplicationFailure
impl Display for ApplicationFailure
Source§impl Error for ApplicationFailure
impl Error for ApplicationFailure
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 From<ApplicationFailure> for OutgoingWorkflowError
impl From<ApplicationFailure> for OutgoingWorkflowError
Source§fn from(value: ApplicationFailure) -> Self
fn from(value: ApplicationFailure) -> Self
Source§impl From<Error> for ApplicationFailure
impl From<Error> for ApplicationFailure
Source§impl From<PayloadConversionError> for ApplicationFailure
impl From<PayloadConversionError> for ApplicationFailure
Source§fn from(value: PayloadConversionError) -> Self
fn from(value: PayloadConversionError) -> Self
Auto Trait Implementations§
impl Freeze for ApplicationFailure
impl !RefUnwindSafe for ApplicationFailure
impl Send for ApplicationFailure
impl Sync for ApplicationFailure
impl Unpin for ApplicationFailure
impl UnsafeUnpin for ApplicationFailure
impl !UnwindSafe for ApplicationFailure
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request