Enum nbt::Error
[−]
[src]
pub enum Error { IoError(Error), InvalidTypeId(u8), HeterogeneousList, NoRootCompound, InvalidUtf8, IncompleteNbtValue, TagMismatch(u8, u8), UnexpectedField(String), }
Errors that may be encountered when constructing, parsing, or encoding
NbtValue
and NbtBlob
objects.
Error
s can be seamlessly converted to more general io::Error
objects
using std::convert::From::from()
.
Variants
IoError(Error)
Wraps errors emitted by methods during I/O operations.
InvalidTypeId(u8)
An error for when an unknown type ID is encountered in decoding NBT binary representations. Includes the ID in question.
HeterogeneousList
An error emitted when trying to create NbtBlob
s with incorrect lists.
NoRootCompound
An error for when NBT binary representations do not begin with an
NbtValue::Compound
.
InvalidUtf8
An error for when NBT binary representations contain invalid UTF-8 strings.
IncompleteNbtValue
An error for when NBT binary representations are missing end tags, contain fewer bytes than advertised, or are otherwise incomplete.
TagMismatch(u8, u8)
An error encountered when parsing NBT binary representations, where deserialization encounters a different tag than expected.
UnexpectedField(String)
An error encountered when parsing NBT binary representations, where deserialization encounters a field name it is not expecting.
Trait Implementations
impl Debug for Error
[src]
impl Display for Error
[src]
impl StdError for Error
[src]
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&StdError>
The lower-level cause of this error, if any. Read more
impl PartialEq<Error> for Error
[src]
fn eq(&self, other: &Error) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl From<Error> for Error
[src]
impl From<FromUtf8Error> for Error
[src]
fn from(_: FromUtf8Error) -> Error
Performs the conversion.