Enum nbt::TagIdent[][src]

#[repr(u8)]pub enum TagIdent {
    TAG_End,
    TAG_Byte,
    TAG_Short,
    TAG_Int,
    TAG_Long,
    TAG_Float,
    TAG_Double,
    TAG_Byte_Array,
    TAG_String,
    TAG_List,
    TAG_Compound,
    TAG_Int_Array,
    TAG_Long_Array,
}

The numerical representation of Tag types.

Used within the internal encode/decode process and hence is returned within errors.

Variants

TAG_End

TAG_End (0)

Signifies the end of a TAG_Compound. It is only ever used inside a TAG_Compound, and is not named despite being in a TAG_Compound

TAG_Byte

TAG_Byte (1)

A single signed byte

TAG_Short

TAG_Short (2)

A single signed, big endian 16 bit integer

TAG_Int

TAG_Int (3)

A single signed, big endian 32 bit integer

TAG_Long

TAG_Long (4)

A single signed, big endian 64 bit integer

TAG_Float

TAG_Float (5)

A single, big endian IEEE-754 single-precision floating point number (NaN possible)

TAG_Double

TAG_Double (6)

A single, big endian IEEE-754 double-precision floating point number (NaN possible)

TAG_Byte_Array

TAG_Byte_Array (7)

A length-prefixed array of signed bytes. The prefix is a signed integer (thus 4 bytes)

TAG_String

TAG_String (8)

A length-prefixed modified UTF-8 string. The prefix is an unsigned short (thus 2 bytes) signifying the length of the string in bytes

TAG_List

TAG_List (9)

A list of nameless tags, all of the same type. The list is prefixed with the Type ID of the items it contains (thus 1 byte), and the length of the list as a signed integer (a further 4 bytes). If the length of the list is 0 or negative, the type may be 0 (TAG_End) but otherwise it must be any other type. (The notchian implementation uses TAG_End in that situation, but another reference implementation by Mojang uses 1 instead; parsers should accept any type if the length is <= 0).

TAG_Compound

TAG_Compound (10)

Effectively a list of a named tags. Order is not guaranteed.

TAG_Int_Array

TAG_Int_Array (11)

A length-prefixed array of signed integers. The prefix is a signed integer (thus 4 bytes) and indicates the number of 4 byte integers.

TAG_Long_Array

TAG_Long_Array (12)

A length-prefixed array of signed longs. The prefix is a signed integer (thus 4 bytes) and indicates the number of 8 byte longs.

Implementations

impl TagIdent[src]

pub fn parse(value: &u8) -> Option<TagIdent>[src]

Parse a u8 into a TagIdent

Trait Implementations

impl Clone for TagIdent[src]

impl Debug for TagIdent[src]

impl Display for TagIdent[src]

impl PartialEq<TagIdent> for TagIdent[src]

impl PartialOrd<TagIdent> for TagIdent[src]

impl StructuralPartialEq for TagIdent[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.