pub struct InvalidRecord {
pub path: String,
pub reason: String,
}Expand description
Why a record does not satisfy its lexicon.
One flat error rather than an enum per constraint. The caller is an HTTP layer turning this into a 400 and the reader is the client that wrote the record, so the field that matters is the path, and a message it can print beats a variant it would have to match on.
Fields§
§path: StringWhere in the record the failure is, as a dotted and indexed path.
reason: StringWhat was wrong, in a sentence.
Implementations§
Source§impl InvalidRecord
impl InvalidRecord
Trait Implementations§
Source§impl Clone for InvalidRecord
impl Clone for InvalidRecord
Source§fn clone(&self) -> InvalidRecord
fn clone(&self) -> InvalidRecord
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 InvalidRecord
impl Debug for InvalidRecord
Source§impl Display for InvalidRecord
impl Display for InvalidRecord
Source§impl Error for InvalidRecord
impl Error for InvalidRecord
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 InvalidRecord
impl PartialEq for InvalidRecord
Source§fn eq(&self, other: &InvalidRecord) -> bool
fn eq(&self, other: &InvalidRecord) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for InvalidRecord
impl StructuralPartialEq for InvalidRecord
Auto Trait Implementations§
impl Freeze for InvalidRecord
impl RefUnwindSafe for InvalidRecord
impl Send for InvalidRecord
impl Sync for InvalidRecord
impl Unpin for InvalidRecord
impl UnsafeUnpin for InvalidRecord
impl UnwindSafe for InvalidRecord
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.