TagIdent

Enum TagIdent 

Source
#[repr(u8)]
pub enum TagIdent {
Show 13 variants TAG_End = 0, TAG_Byte = 1, TAG_Short = 2, TAG_Int = 3, TAG_Long = 4, TAG_Float = 5, TAG_Double = 6, TAG_Byte_Array = 7, TAG_String = 8, TAG_List = 9, TAG_Compound = 10, TAG_Int_Array = 11, TAG_Long_Array = 12,
}
Expand description

The numerical representation of Tag types.

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

Variants§

§

TAG_End = 0

§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 = 1

§TAG_Byte (1)

A single signed byte

§

TAG_Short = 2

§TAG_Short (2)

A single signed, big endian 16 bit integer

§

TAG_Int = 3

§TAG_Int (3)

A single signed, big endian 32 bit integer

§

TAG_Long = 4

§TAG_Long (4)

A single signed, big endian 64 bit integer

§

TAG_Float = 5

§TAG_Float (5)

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

§

TAG_Double = 6

§TAG_Double (6)

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

§

TAG_Byte_Array = 7

§TAG_Byte_Array (7)

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

§

TAG_String = 8

§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 = 9

§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 = 10

§TAG_Compound (10)

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

§

TAG_Int_Array = 11

§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 = 12

§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§

Source§

impl TagIdent

Source

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

Parse a u8 into a TagIdent

Trait Implementations§

Source§

impl Clone for TagIdent

Source§

fn clone(&self) -> TagIdent

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TagIdent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TagIdent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TagIdent

Source§

fn eq(&self, other: &TagIdent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for TagIdent

Source§

fn partial_cmp(&self, other: &TagIdent) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for TagIdent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.