pub enum ErrorCode {
NotAnObject,
UnknownField,
Required,
WrongType,
TooShort,
TooLong,
TooSmall,
TooLarge,
NotInEnum,
BadFormat,
NulByte,
}Expand description
The stable vocabulary a conformance case is matched on. Messages are prose and may be reworded; a code may not, because a second implementation asserts against it.
Variants§
NotAnObject
The row was not a JSON object.
UnknownField
The row carried a key the table does not declare.
Required
A field that must be present was absent or null.
WrongType
The value had the wrong JSON type for its kind.
TooShort
A string was shorter than min_len characters.
TooLong
A string was longer than max_len characters.
TooSmall
A number was below min.
TooLarge
A number was above max.
NotInEnum
A string was not one of an enum’s declared values.
BadFormat
A string did not match its declared format: email, url, a
timestamp or a UUID.
NulByte
A string carried U+0000, which no text column can hold.
SQLite stores it and Postgres refuses the whole statement
(22P05), so without this the same declaration serves two
behaviours: a row that writes in development and a 500 in
production. Refused in the validator so the answer is a 422
naming the column rather than a database error naming nothing the
caller sent.
Implementations§
Trait Implementations§
impl Copy for ErrorCode
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
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>,
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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
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
key and return true if they are equal.