pub enum DeserializeError<E> {
Parser(E),
Reflect {
error: ReflectError,
span: Option<Span>,
path: Option<Path>,
},
TypeMismatch {
expected: &'static str,
got: String,
span: Option<Span>,
path: Option<Path>,
},
Unsupported(String),
UnknownField {
field: String,
span: Option<Span>,
path: Option<Path>,
},
CannotBorrow {
message: String,
},
MissingField {
field: &'static str,
type_name: &'static str,
span: Option<Span>,
path: Option<Path>,
},
UnexpectedEof {
expected: &'static str,
},
}Expand description
Error produced by the format deserializer.
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
Unknown field encountered when deny_unknown_fields is set.
Fields
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 const fn reflect(error: ReflectError) -> Self
pub const fn reflect(error: ReflectError) -> Self
Create a Reflect error without span or path information.
Sourcepub const fn reflect_with_span(error: ReflectError, span: Span) -> Self
pub const fn reflect_with_span(error: ReflectError, span: Span) -> Self
Create a Reflect error with span information.
Sourcepub const fn reflect_with_context(
error: ReflectError,
span: Option<Span>,
path: Path,
) -> Self
pub const fn reflect_with_context( error: ReflectError, span: Option<Span>, path: Path, ) -> Self
Create a Reflect error with span and path information.
Trait Implementations§
Source§impl<E: Debug> Debug for DeserializeError<E>
impl<E: Debug> Debug for DeserializeError<E>
Source§impl<E: Display> Display for DeserializeError<E>
impl<E: Display> Display for DeserializeError<E>
Source§impl<E: Debug + Display> Error for DeserializeError<E>
impl<E: Debug + Display> 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