pub enum DeserializeError<E> {
Parser(E),
Reflect {
error: ReflectError,
span: Option<Span>,
},
TypeMismatch {
expected: &'static str,
got: String,
},
Unsupported(String),
UnknownField(String),
CannotBorrow {
message: String,
},
MissingField {
field: &'static str,
type_name: &'static str,
},
UnexpectedEof {
expected: &'static str,
},
}Expand description
Error produced by FormatDeserializer.
Variants§
Parser(E)
Error emitted by the format-specific parser.
Reflect
Reflection error from Partial operations.
Fields
§
error: ReflectErrorThe underlying reflection error.
TypeMismatch
Type mismatch during deserialization.
Fields
Unsupported(String)
Unsupported type or operation.
UnknownField(String)
Unknown field encountered when deny_unknown_fields is set.
CannotBorrow
Cannot borrow string from input (e.g., escaped string into &str).
MissingField
Required field missing from input.
Fields
UnexpectedEof
Unexpected end of input.
Implementations§
Source§impl<E> DeserializeError<E>
impl<E> DeserializeError<E>
Sourcepub fn reflect(error: ReflectError) -> DeserializeError<E>
pub fn reflect(error: ReflectError) -> DeserializeError<E>
Create a Reflect error without span information.
Sourcepub fn reflect_with_span(error: ReflectError, span: Span) -> DeserializeError<E>
pub fn reflect_with_span(error: ReflectError, span: Span) -> DeserializeError<E>
Create a Reflect error with span information.
Trait Implementations§
Source§impl<E> Debug for DeserializeError<E>where
E: Debug,
impl<E> Debug for DeserializeError<E>where
E: Debug,
Source§impl<E> Display for DeserializeError<E>where
E: Display,
impl<E> Display for DeserializeError<E>where
E: Display,
Source§impl<E> Error for DeserializeError<E>
impl<E> Error for DeserializeError<E>
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()
Auto Trait Implementations§
impl<E> Freeze for DeserializeError<E>where
E: Freeze,
impl<E> RefUnwindSafe for DeserializeError<E>where
E: RefUnwindSafe,
impl<E> Send for DeserializeError<E>where
E: Send,
impl<E> Sync for DeserializeError<E>where
E: Sync,
impl<E> Unpin for DeserializeError<E>where
E: Unpin,
impl<E> UnwindSafe for DeserializeError<E>where
E: UnwindSafe,
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