pub struct EnvelopeError {
pub code: String,
pub message: String,
pub hint: Option<String>,
pub details: Option<Value>,
}Expand description
Structured error rendered inside the JSON envelope’s error field.
Fields§
§code: String§message: String§hint: Option<String>§details: Option<Value>Implementations§
Source§impl EnvelopeError
impl EnvelopeError
Sourcepub fn new(code: impl Into<String>, message: impl Into<String>) -> Self
pub fn new(code: impl Into<String>, message: impl Into<String>) -> Self
Build an error with a code and message.
Sourcepub fn with_hint(self, hint: impl Into<String>) -> Self
pub fn with_hint(self, hint: impl Into<String>) -> Self
Attach an optional human-readable hint to the error.
Sourcepub fn with_details(self, details: Value) -> Self
pub fn with_details(self, details: Value) -> Self
Attach optional machine-readable structured detail to the error (e.g. the offending payload path).
Trait Implementations§
Source§impl Clone for EnvelopeError
impl Clone for EnvelopeError
Source§fn clone(&self) -> EnvelopeError
fn clone(&self) -> EnvelopeError
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 EnvelopeError
impl Debug for EnvelopeError
Auto Trait Implementations§
impl Freeze for EnvelopeError
impl RefUnwindSafe for EnvelopeError
impl Send for EnvelopeError
impl Sync for EnvelopeError
impl Unpin for EnvelopeError
impl UnsafeUnpin for EnvelopeError
impl UnwindSafe for EnvelopeError
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