pub enum Error {
Show 16 variants
WriteSerialized(Error),
ReadSerialized(Error),
UnexpectedEof,
Unexpected {
expected: char,
actual: char,
},
ExpectedDigit {
actual: char,
},
Utf8Error(Utf8Error),
CharConversionFailed(CharTryFromError),
NotAValidNumber(Box<dyn Error + Send + Sync>),
InvalidBooleanValue(char),
UnsupportedArrayKeyType(char),
InvalidTypeIndicator(char),
MissingFeature(&'static str),
IndexMismatch {
expected: usize,
actual: usize,
},
LengthRequired,
SerializationFailed(String),
DeserializationFailed(String),
}Expand description
PHP serialization/deserialization error.
Variants§
WriteSerialized(Error)
Error writing serializated value: {0}
ReadSerialized(Error)
Error reading serializing value: {0}
UnexpectedEof
Unexpected end of file while reading,
Unexpected
Expected {expected} but got {actual} instead.
ExpectedDigit
Expected a digit, but got {actual} instead.
Utf8Error(Utf8Error)
Deserialized bytestring is not valid UTF: {0}
CharConversionFailed(CharTryFromError)
Could not convert into char from decimal value: {0}
NotAValidNumber(Box<dyn Error + Send + Sync>)
Not a valid number or incorrect number type: {0}
InvalidBooleanValue(char)
Not a valid value for boolean: {0}
UnsupportedArrayKeyType(char)
Unsupported array key type (must be all strings or all numeric): {0}
InvalidTypeIndicator(char)
Invalid type indicator on value: {0}
MissingFeature(&'static str)
Feature not implemented by serde_php: {0}
IndexMismatch
Array-index mismatch (must be in-order and numeric), expected {expected} but got {actual}
LengthRequired
Attempted to serialize sequence of unknown length.
PHP requires all collections to be length prefixed. Serializing sequences of unknown length requires writing these to a memory buffer with potentially unbounded space requirements and is thus disabled.
SerializationFailed(String)
PHP Deserialization failed: {0}
DeserializationFailed(String)
PHP Serialization failed: {0}
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl Error for Error
impl Error for Error
Source§fn custom<T>(msg: T) -> Selfwhere
T: Display,
fn custom<T>(msg: T) -> Selfwhere
T: Display,
Source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a type different from what it was
expecting. Read moreSource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a value of the right type but that
is wrong for some other reason. Read moreSource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Deserialize enum type received a variant with an
unrecognized name.Source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Deserialize struct type received a field with an
unrecognized name.Source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Deserialize struct type expected to receive a required
field with a particular name but that field was not present in the
input.Source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Deserialize struct type received more than one of the
same field.