#[non_exhaustive]pub struct BackendError {
pub category: ClientErrorCategory,
pub message: String,
pub retry_after_seconds: Option<u64>,
}Expand description
Redacted backend error.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.category: ClientErrorCategoryStable error category.
message: StringRedacted message suitable for hosts.
retry_after_seconds: Option<u64>Server-requested retry delay, when the failure is rate limited.
Implementations§
Source§impl BackendError
impl BackendError
Sourcepub fn new(category: ClientErrorCategory, message: impl Into<String>) -> Self
pub fn new(category: ClientErrorCategory, message: impl Into<String>) -> Self
Creates a backend error.
Sourcepub fn with_retry_after_seconds(self, seconds: u64) -> Self
pub fn with_retry_after_seconds(self, seconds: u64) -> Self
Attaches a server-requested retry delay.
Trait Implementations§
Source§impl Clone for BackendError
impl Clone for BackendError
Source§fn clone(&self) -> BackendError
fn clone(&self) -> BackendError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BackendError
impl Debug for BackendError
Source§impl Display for BackendError
impl Display for BackendError
impl Eq for BackendError
Source§impl Error for BackendError
impl Error for BackendError
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<BackendError> for ClientFailure
impl From<BackendError> for ClientFailure
Source§fn from(error: BackendError) -> Self
fn from(error: BackendError) -> Self
Converts to this type from the input type.
Source§impl From<BackendError> for ClientRequestError
impl From<BackendError> for ClientRequestError
Source§fn from(source: BackendError) -> Self
fn from(source: BackendError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for BackendError
impl PartialEq for BackendError
impl StructuralPartialEq for BackendError
Auto Trait Implementations§
impl Freeze for BackendError
impl RefUnwindSafe for BackendError
impl Send for BackendError
impl Sync for BackendError
impl Unpin for BackendError
impl UnsafeUnpin for BackendError
impl UnwindSafe for BackendError
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