[][src]Enum nobility::TagType

#[repr(u8)]
#[non_exhaustive]pub enum TagType {
    End,
    Byte,
    Short,
    Int,
    Long,
    Float,
    Double,
    ByteArray,
    String,
    List,
    Compound,
    IntArray,
    LongArray,
}

NBT tags are a 1-byte value used to specify which type is going to follow. The integer values of each enum corresponds to the actual ones used, and tag as u8 can be used to cast these to their binary representation.

Tags are sequentially allocated. As of writing (2020), the most recent tag is TAG_Long_Array, added in Minecraft 1.12.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
End

Used to mark the end of a Compound tag. TAG_End, ID 0.

Byte

Contains an i8. TAG_Byte, ID 1.

Short

Contains an i16. TAG_Short, ID 2.

Int

Contains an i32. TAG_Int, ID 3.

Long

Contains an i64. TAG_Long, ID 4.

Float

Contains an f32. TAG_Float, ID 5.

Double

Contains an f64. TAG_Double, ID 6.

ByteArray

Contains a &[u8]. TAG_Byte_Array, ID 7.

String

Contains a bin_decode::NbtString. TAG_String, ID 8.

List

Contains a bin_decode::List with the list of its elements as a second tag. TAG_List, ID 9.

Compound

Contains a bin_decode::Compound. This is a key-value map, but ordered. TAG_Compound, ID 10.

IntArray

Contains a bin_decode::IntArray. TAG_Int_Array, ID 11.

LongArray

Contains a bin_decode::LongArray. TAG_Long_Array, ID 12.

Trait Implementations

impl Clone for TagType[src]

impl Copy for TagType[src]

impl Debug for TagType[src]

impl Eq for TagType[src]

impl Hash for TagType[src]

impl Ord for TagType[src]

impl PartialEq<TagType> for TagType[src]

impl PartialOrd<TagType> for TagType[src]

impl StructuralEq for TagType[src]

impl StructuralPartialEq for TagType[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, 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.