pub enum UcPackError {
BadVariant,
Eof,
NoSupport(&'static str),
TooLong,
BufferFull,
SerError(String),
DeError(String),
InvalidData,
WrongCrc,
WrongIndex,
}Expand description
Error returned by the ucpack crate
Variants§
BadVariant
Tried to serialize a variant index bigger than 255.
Eof
The cursor does not have any more data to deserialize from.
NoSupport(&'static str)
Serialization / Deserialization of this type is not supported by the ucpack protocol. If you think this is a mistake, please open an issue.
TooLong
Tried to serialize more than 256 bytes of payload data. This is a restriction imposed by the protocol.
BufferFull
Tried to serialize more bytes than the buffer could possible handle.
SerError(String)
DeError(String)
InvalidData
Input data for deserialization has problems finding a representation in a given data format
For example: a serialized boolean value ∉ {0, 1}
WrongCrc
Received a message with a wrong/faulty crc. Probably indicates data corruption.
WrongIndex
Received a message containing wrong index/indices for the start and stop bytes.
Trait Implementations§
Source§impl Debug for UcPackError
impl Debug for UcPackError
Source§impl Display for UcPackError
impl Display for UcPackError
Source§impl Error for UcPackError
Available on crate feature std only.
impl Error for UcPackError
std only.1.30.0 · 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
Source§impl Error for UcPackError
impl Error for UcPackError
Source§impl Error for UcPackError
impl Error for UcPackError
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.