pub struct JudgmentError { /* private fields */ }Expand description
A classed judgment failure. message never contains the key, is at most
MAX_ERROR_MESSAGE_CHARS chars, and carries only a short reason (an
HTTP status, a decode reason) — never the upstream body.
The fields are private and the only constructor,
JudgmentError::scrubbed, scrubs the message of the key, so no caller
can build an error carrying it.
Implementations§
Source§impl JudgmentError
impl JudgmentError
Sourcepub fn scrubbed(
kind: JudgmentErrorKind,
message: impl AsRef<str>,
key: &ApiKey,
) -> Self
pub fn scrubbed( kind: JudgmentErrorKind, message: impl AsRef<str>, key: &ApiKey, ) -> Self
Build an error whose message is ApiKey::excerpted: scrubbed of
key, then cut to MAX_ERROR_MESSAGE_CHARS.
Sourcepub fn kind(&self) -> JudgmentErrorKind
pub fn kind(&self) -> JudgmentErrorKind
The failure class.
Trait Implementations§
Source§impl Clone for JudgmentError
impl Clone for JudgmentError
Source§impl Debug for JudgmentError
impl Debug for JudgmentError
Source§impl Display for JudgmentError
impl Display for JudgmentError
impl Eq for JudgmentError
Source§impl Error for JudgmentError
impl Error for JudgmentError
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 PartialEq for JudgmentError
impl PartialEq for JudgmentError
impl StructuralPartialEq for JudgmentError
Auto Trait Implementations§
impl Freeze for JudgmentError
impl RefUnwindSafe for JudgmentError
impl Send for JudgmentError
impl Sync for JudgmentError
impl Unpin for JudgmentError
impl UnsafeUnpin for JudgmentError
impl UnwindSafe for JudgmentError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.