pub struct UdbError {
pub status: Status,
pub detail: Option<ErrorDetail>,
}Expand description
A Status plus the broker’s structured detail, when it sent one.
Fields§
§status: Status§detail: Option<ErrorDetail>Implementations§
Source§impl UdbError
impl UdbError
Sourcepub fn from_status(status: Status) -> Self
pub fn from_status(status: Status) -> Self
Decode the trailer, if present and well-formed.
A malformed trailer is treated as absent rather than as a new failure: the call already failed and the caller needs the original status, not a decoding complaint layered over it.
pub fn code(&self) -> Code
pub fn message(&self) -> &str
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether the BROKER said this is retryable.
Trusted over any code-based guess: the broker knows whether it got far
enough to have side effects, and a client cannot infer that from
UNAVAILABLE alone.
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
How long the broker asked us to wait, if it said.
Sourcepub fn capability_required(&self) -> Option<&str>
pub fn capability_required(&self) -> Option<&str>
The capability the deployment is missing, for a capability refusal.
Sourcepub fn correlation_id(&self) -> Option<&str>
pub fn correlation_id(&self) -> Option<&str>
The correlation id to quote in a bug report or a support ticket.
Sourcepub fn field_violations(&self) -> &[ErrorFieldViolation]
pub fn field_violations(&self) -> &[ErrorFieldViolation]
Per-field rejections, for a validation failure.
Trait Implementations§
Source§impl Error for UdbError
impl Error for UdbError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for UdbError
impl !UnwindSafe for UdbError
impl Freeze for UdbError
impl Send for UdbError
impl Sync for UdbError
impl Unpin for UdbError
impl UnsafeUnpin for UdbError
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request