Enum quartz_nbt::io::NbtIoError
source · pub enum NbtIoError {
Show 14 variants
StdIo(Error),
MissingRootTag,
NonHomogenousList {
list_type: u8,
encountered_type: u8,
},
OptionInList,
MissingLength,
InvalidTagId(u8),
TagTypeMismatch {
expected: u8,
found: u8,
},
ExpectedSeq,
ExpectedEnum,
InvalidKey,
InvalidEnumVariant,
InvalidCesu8String,
UnsupportedType(&'static str),
Custom(Box<str>),
}
Expand description
Describes an error which occurred during the reading or writing of NBT data.
Variants§
StdIo(Error)
A native I/O error.
MissingRootTag
No root tag was found. All NBT data must start with a valid compound tag.
NonHomogenousList
A sequential data structure was found to be non-homogenous. All sequential structures in NBT data are homogenous.
OptionInList
A type requested an option to be read from a list. Since options are indicated by the absence or presence of a tag, and since all sequential types are length-prefixed, options cannot exists within arrays in NBT data.
MissingLength
A sequential type without a definite length was passed to a serializer.
InvalidTagId(u8)
An invalid tag ID was encountered.
TagTypeMismatch
The first tag ID was expected, but the second was found.
ExpectedSeq
A sequential type was expected, but another was found.
ExpectedEnum
An enum representation was expected, but another was found.
InvalidKey
An invalid map key was encountered.
InvalidEnumVariant
An invalid enum variant was encountered.
InvalidCesu8String
An invalid cesu8 string was encountered.
UnsupportedType(&'static str)
An unsupported type was passed to a serializer or queried from a deserializer.
Custom(Box<str>)
A custom error message.
Trait Implementations§
source§impl Debug for NbtIoError
impl Debug for NbtIoError
source§impl Display for NbtIoError
impl Display for NbtIoError
source§impl Error for NbtIoError
impl Error for NbtIoError
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.