pub struct DecodeError {
pub path: Place,
pub problem: String,
pub kind: DecodeErrorKind,
}Expand description
Why decoding refused. path and kind are json.DecodeError’s
path and problem (stdlib.md); problem says the same for a
person. A Tool reply that fails decoding is no answer, and this explains
why (abi.md, Decoding).
Fields§
§path: PlaceThe place in the value that failed, such as steps[2].owner; empty
for the whole value.
problem: StringWhat was wrong there, for a person.
kind: DecodeErrorKindWhich refusal it is: json.Problem’s case.
Implementations§
Source§impl DecodeError
impl DecodeError
Sourcepub fn for_subject(&self, subject: &str) -> String
pub fn for_subject(&self, subject: &str) -> String
The error said of subject, the value that was decoded, such as an
input by its name: the subject and then the problem, or, for a place
inside the value, that place in the subject and then the problem.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§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)>
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<DecodeError> for EncodeError
A description that does not read back is one that does not validate.
impl From<DecodeError> for EncodeError
A description that does not read back is one that does not validate.
Source§fn from(error: DecodeError) -> Self
fn from(error: DecodeError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
impl StructuralPartialEq for DecodeError
Auto Trait Implementations§
impl Forget for DecodeError
impl Freeze for DecodeError
impl Move for DecodeError
impl RefUnwindSafe for DecodeError
impl Send for DecodeErrorwhere
RawVecInner: Send,
impl Sync for DecodeErrorwhere
RawVecInner: Sync,
impl Unpin for DecodeError
impl UnsafeUnpin for DecodeErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Step>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for DecodeErrorwhere
RawVecInner: 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