Trait serde::de::Error
[−]
[src]
pub trait Error: Sized { fn syntax(msg: &str) -> Self; fn end_of_stream() -> Self; fn unknown_field(field: &str) -> Self; fn missing_field(field: &'static str) -> Self; fn length_mismatch(_len: usize) -> Self { ... } fn type_mismatch(_type: Type) -> Self { ... } fn invalid_value(msg: &str) -> Self { ... } }
Error
is a trait that allows a Deserialize
to generically create a
Deserializer
error.
Required Methods
fn syntax(msg: &str) -> Self
Raised when there is general error when deserializing a type.
fn end_of_stream() -> Self
Raised when a Deserialize
type unexpectedly hit the end of the stream.
fn unknown_field(field: &str) -> Self
Raised when a Deserialize
struct type received an unexpected struct field.
fn missing_field(field: &'static str) -> Self
Raised when a Deserialize
struct type did not receive a field.
Provided Methods
fn length_mismatch(_len: usize) -> Self
Raised when a fixed sized sequence or map was passed in the wrong amount of arguments.
fn type_mismatch(_type: Type) -> Self
Raised when a Deserialize
was passed an incorrect type.
fn invalid_value(msg: &str) -> Self
Raised when a Deserialize
was passed an incorrect value.