Enum serde::de::value::Error
[−]
[src]
pub enum Error { Custom(String), InvalidType(Type), InvalidLength(usize), InvalidValue(String), EndOfStream, UnknownVariant(String), UnknownField(String), MissingField(&'static str), }
This represents all the possible errors that can occur using the ValueDeserializer
.
Variants
Custom(String)
The value had some custom error.
InvalidType(Type)
The value had an incorrect type.
InvalidLength(usize)
The value had an invalid length.
InvalidValue(String)
The value is invalid and cannot be deserialized.
EndOfStream
EOF while deserializing a value.
UnknownVariant(String)
Unknown variant in enum.
UnknownField(String)
Unknown field in struct.
MissingField(&'static str)
Struct is missing a field.
Trait Implementations
impl PartialEq for Error
[src]
fn eq(&self, __arg_0: &Error) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Error) -> bool
This method tests for !=
.
impl Debug for Error
[src]
impl Clone for Error
[src]
fn clone(&self) -> Error
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Error for Error
[src]
fn custom<T: Into<String>>(msg: T) -> 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 invalid_type(ty: 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.
fn invalid_length(len: usize) -> Self
Raised when a fixed sized sequence or map was passed in the wrong amount of arguments. Read more
fn unknown_variant(variant: &str) -> Self
Raised when a Deserialize
enum type received an unexpected variant.
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.
fn duplicate_field(field: &'static str) -> Self
Raised when a Deserialize
struct type received more than one of the same struct field. Read more
impl Display for Error
[src]
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.