pub struct DeserializeError {
pub span: Option<Span>,
pub path: Option<Path>,
pub kind: DeserializeErrorKind,
}Expand description
Error produced by the format deserializer.
This struct contains span and path information at the top level,
with a kind field describing the specific error.
Fields§
§span: Option<Span>Source span where the error occurred (if available).
path: Option<Path>Path through the type structure where the error occurred.
kind: DeserializeErrorKindThe specific kind of error.
Implementations§
Source§impl DeserializeError
impl DeserializeError
Sourcepub fn set_span(self, span: Span) -> DeserializeError
pub fn set_span(self, span: Span) -> DeserializeError
Add span information to this error.
Sourcepub fn set_path(self, path: Path) -> DeserializeError
pub fn set_path(self, path: Path) -> DeserializeError
Add path information to this error.
Sourcepub fn with_path(self, new_path: Path) -> DeserializeError
pub fn with_path(self, new_path: Path) -> DeserializeError
Add path information to an error (consumes and returns the modified error).
Trait Implementations§
Source§impl Debug for DeserializeError
impl Debug for DeserializeError
Source§impl Display for DeserializeError
impl Display for DeserializeError
Source§impl Error for DeserializeError
impl Error for DeserializeError
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 From<AllocError> for DeserializeError
impl From<AllocError> for DeserializeError
Source§fn from(e: AllocError) -> DeserializeError
fn from(e: AllocError) -> DeserializeError
Converts to this type from the input type.
Source§impl From<ParseError> for DeserializeError
impl From<ParseError> for DeserializeError
Source§fn from(e: ParseError) -> DeserializeError
fn from(e: ParseError) -> DeserializeError
Converts to this type from the input type.
Source§impl From<ReflectError> for DeserializeError
impl From<ReflectError> for DeserializeError
Source§fn from(e: ReflectError) -> DeserializeError
fn from(e: ReflectError) -> DeserializeError
Converts to this type from the input type.
Source§impl From<ShapeMismatchError> for DeserializeError
impl From<ShapeMismatchError> for DeserializeError
Source§fn from(e: ShapeMismatchError) -> DeserializeError
fn from(e: ShapeMismatchError) -> DeserializeError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DeserializeError
impl RefUnwindSafe for DeserializeError
impl Send for DeserializeError
impl Sync for DeserializeError
impl Unpin for DeserializeError
impl UnsafeUnpin for DeserializeError
impl UnwindSafe for DeserializeError
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