pub enum AbxError {
InvalidMagic {
expected: [u8; 4],
actual: [u8; 4],
},
UnexpectedEof(&'static str),
BadInternedIndex(u16),
InvalidUtf8,
UnknownAttributeType(u8),
UnknownCommand(u8),
ValueTooLong {
len: usize,
max: usize,
},
Nom(String),
Io(Error),
Deserialization(String),
Xml(String),
}Expand description
Everything that can go wrong parsing, encoding, or deserializing ABX data.
Variants§
InvalidMagic
The 4-byte ABX\0 magic header didn’t match at the start of the input.
Fields
UnexpectedEof(&'static str)
The input ended before a complete token or value could be read.
BadInternedIndex(u16)
An interned-string back-reference pointed past the end of the pool.
InvalidUtf8
A string’s bytes were not valid UTF-8.
UnknownAttributeType(u8)
An attribute value’s type nibble didn’t match any known TYPE_* constant.
UnknownCommand(u8)
A token’s command nibble didn’t match any known CMD_* constant.
ValueTooLong
A string or byte blob was too long to fit the wire format’s u16 length prefix.
Fields
Nom(String)
The underlying nom parser failed; the message is nom’s own formatted error.
Io(Error)
A read or write on the underlying Read/Write failed.
Deserialization(String)
Mapping decoded ABX events onto a serde type failed (serialize feature).
Xml(String)
Parsing XML text failed while encoding it to ABX (xml feature).
Trait Implementations§
Source§impl Error for AbxError
impl Error for AbxError
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 AbxError
impl Error for AbxError
Source§fn custom<T: Display>(msg: T) -> Self
fn custom<T: Display>(msg: T) -> Self
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.