Struct rocket_contrib::SerdeError []

pub struct SerdeError { /* fields omitted */ }

This type represents all possible errors that can occur when serializing or deserializing JSON data.

Methods

impl Error

One-based line number at which the error was detected.

Characters in the first line of the input (before the first newline character) are in line 1.

One-based column number at which the error was detected.

The first character in the input and any characters immediately following a newline character are in column 1.

Note that errors may occur in column 0, for example if a read from an IO stream fails immediately following a previously read newline character.

Categorizes the cause of this error.

  • Category::Io - failure to read or write bytes on an IO stream
  • Category::Syntax - input that is not syntactically valid JSON
  • Category::Data - input data that is semantically incorrect
  • Category::Eof - unexpected end of the input data

Returns true if this error was caused by a failure to read or write bytes on an IO stream.

Returns true if this error was caused by input that was not syntactically valid JSON.

Returns true if this error was caused by input data that was semantically incorrect.

For example, JSON containing a number is semantically incorrect when the type being deserialized into holds a String.

Returns true if this error was caused by prematurely reaching the end of the input data.

Callers that process streaming input may be interested in retrying the deserialization once more data is available.

Trait Implementations

impl Error for Error

impl Error for Error

impl Error for Error

impl From<ErrorImpl> for Error

impl From<Error> for Error

impl From<Error> for Error

impl Debug for Error

Formats the value using the given formatter.

impl Display for Error