pub struct ErrorSpec { /* private fields */ }Expand description
Stable fields that are safe to return to a caller.
Implementations§
Source§impl ErrorSpec
impl ErrorSpec
Sourcepub fn new(code: impl Into<String>, message: impl Into<String>) -> Self
pub fn new(code: impl Into<String>, message: impl Into<String>) -> Self
Declare a stable error code and public message.
Sourcepub const fn retryable(self, retryable: bool) -> Self
pub const fn retryable(self, retryable: bool) -> Self
Declare whether retrying may succeed without changing the request.
pub fn code(&self) -> &str
pub fn message(&self) -> &str
pub fn hint_value(&self) -> Option<&str>
pub const fn is_retryable(&self) -> bool
Sourcepub fn builder(&self) -> ErrorBuilder
pub fn builder(&self) -> ErrorBuilder
Start an error builder using only catalogued public fields.
Applications may add explicitly selected structured fields to the returned builder. No runtime diagnostic is accepted by this API.
Sourcepub fn event(&self) -> Result<Event, BuildError>
pub fn event(&self) -> Result<Event, BuildError>
Build the strict protocol error event.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ErrorSpec
impl<'de> Deserialize<'de> for ErrorSpec
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 ErrorSpec
impl StructuralPartialEq for ErrorSpec
Auto Trait Implementations§
impl Freeze for ErrorSpec
impl RefUnwindSafe for ErrorSpec
impl Send for ErrorSpec
impl Sync for ErrorSpec
impl Unpin for ErrorSpec
impl UnsafeUnpin for ErrorSpec
impl UnwindSafe for ErrorSpec
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.