pub struct ClientErrorEnvelope {
pub code: ClientErrorCode,
pub retryable: bool,
pub retry_after_ms: Option<u64>,
pub message: String,
}Expand description
Stable error envelope.
Fields§
§code: ClientErrorCodeStable machine-readable error code.
retryable: boolWhether the SDK may retry.
retry_after_ms: Option<u64>Optional retry-after in milliseconds.
message: StringRedacted message for humans.
Implementations§
Source§impl ClientErrorEnvelope
impl ClientErrorEnvelope
Sourcepub fn new(
code: ClientErrorCode,
retryable: bool,
message: impl Into<String>,
) -> Self
pub fn new( code: ClientErrorCode, retryable: bool, message: impl Into<String>, ) -> Self
Create a redacted error envelope.
Sourcepub fn with_retry_after_ms(self, retry_after_ms: u64) -> Self
pub fn with_retry_after_ms(self, retry_after_ms: u64) -> Self
Attach retry-after.
Trait Implementations§
Source§impl Clone for ClientErrorEnvelope
impl Clone for ClientErrorEnvelope
Source§fn clone(&self) -> ClientErrorEnvelope
fn clone(&self) -> ClientErrorEnvelope
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 ClientErrorEnvelope
impl Debug for ClientErrorEnvelope
Source§impl<'de> Deserialize<'de> for ClientErrorEnvelope
impl<'de> Deserialize<'de> for ClientErrorEnvelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ClientErrorEnvelope
Source§impl PartialEq for ClientErrorEnvelope
impl PartialEq for ClientErrorEnvelope
Source§fn eq(&self, other: &ClientErrorEnvelope) -> bool
fn eq(&self, other: &ClientErrorEnvelope) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ClientErrorEnvelope
impl Serialize for ClientErrorEnvelope
impl StructuralPartialEq for ClientErrorEnvelope
Auto Trait Implementations§
impl Freeze for ClientErrorEnvelope
impl RefUnwindSafe for ClientErrorEnvelope
impl Send for ClientErrorEnvelope
impl Sync for ClientErrorEnvelope
impl Unpin for ClientErrorEnvelope
impl UnsafeUnpin for ClientErrorEnvelope
impl UnwindSafe for ClientErrorEnvelope
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