pub enum NbtError {
UnknownErr(String),
WrongRootType(u8),
RootWithoutName,
UnknownType(u8),
NameRead(String),
Overflow(usize, usize, usize),
VarIntTooBig(usize),
VarLongTooBig(usize),
ListTypeNotSame(Vec<NbtTypeId>),
IncorrectType(NbtTypeId, NbtTypeId),
}Expand description
Error enum to describe an error that occurs while reading/writing NBT data
Variants§
UnknownErr(String)
Variant for unknown errors
WrongRootType(u8)
This error occures if the root of the nbt data is not a Compound
RootWithoutName
This error occures if the root of the nbt data has no name but the name is required
UnknownType(u8)
This error occures if the parsing reads and unknown type id
NameRead(String)
This error occurs, if the parsing fails to read a name
Overflow(usize, usize, usize)
This error occurs, if the parsing tries to read more data than supplied
VarIntTooBig(usize)
This error occurs, if a value is too large to be a VarInt, but a VarInt is expected
VarLongTooBig(usize)
This error occurs, if a value is too large to be a VarLong, but a VarLong is expected
ListTypeNotSame(Vec<NbtTypeId>)
This error occurs, if elements in a list are not the same type
IncorrectType(NbtTypeId, NbtTypeId)
This error occurs, if a specific type is expected, but an other one is found
Trait Implementations§
source§impl Error for NbtError
impl Error for NbtError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl PartialEq for NbtError
impl PartialEq for NbtError
impl Eq for NbtError
impl StructuralPartialEq for NbtError
Auto Trait Implementations§
impl Freeze for NbtError
impl RefUnwindSafe for NbtError
impl Send for NbtError
impl Sync for NbtError
impl Unpin for NbtError
impl UnwindSafe for NbtError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more