#[non_exhaustive]pub enum DecodeError {
NoDecoderForType {
column: String,
},
NotYetImplemented {
decoder: &'static str,
},
InvalidUtf8 {
column: String,
},
InvalidUuid {
column: String,
source_len: usize,
},
InvalidHexEscape {
column: String,
at: usize,
},
IntegerOverflow {
column: String,
digits: String,
},
DecimalPrecisionLoss {
column: String,
},
JsonNotSerializable {
column: String,
error: String,
},
WrongPayloadKind {
column: String,
expected: &'static str,
actual: &'static str,
},
Custom {
column: String,
message: String,
},
}Expand description
Failure modes shared across every wire::Decoder implementation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoDecoderForType
The TypeMap contains no decoder for the
wire type carried by this column.
NotYetImplemented
The decoder skeleton exists but its implementation is not yet populated.
InvalidUtf8
Column payload was expected to be valid UTF-8 and was not.
InvalidUuid
Column payload did not parse as a UUID (36-char hyphenated or braced form).
Fields
InvalidHexEscape
Column payload was expected to be a \xHEX PG BYTEA escape and
contained an invalid character at the reported byte offset.
Fields
IntegerOverflow
Integer payload exceeded i64 range and its shape (MySQL
bigint unsigned, PG numeric cast, …) did not permit a
silent fallback to Text.
Fields
DecimalPrecisionLoss
Column carried a decimal that was delivered as a JSON number, which cannot preserve precision above ~15 significant digits.
JsonNotSerializable
JSON payload failed to serialize into the target text form.
Only observable when a JSON decoder receives a value that
serde_json cannot round-trip through to_string.
WrongPayloadKind
Payload kind was not what this decoder expected. Emitted when a decoder registered for one shape (e.g. JSON string) receives a different one (e.g. JSON object).
Fields
Custom
Free-form failure emitted by user-supplied decoders.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
impl StructuralPartialEq for DecodeError
Auto Trait Implementations§
impl Freeze for DecodeError
impl RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnsafeUnpin for DecodeError
impl UnwindSafe for DecodeError
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,
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.