Enum NbtTag

Source
pub enum NbtTag {
Show 16 variants End, Byte(u8), Short(i16), Int(i32), Long(i64), Float(f32), Double(f64), ByteArray(NbtArray<u8>), String(String), List(NbtList), Compound(NbtCompound), IntArray(NbtArray<i32>), LongArray(NbtArray<i64>), FloatArray(NbtArray<f32>), DoubleArray(NbtArray<f64>), Uuid(UUID),
}
Expand description

An NBT Tag

Variants§

§

End

The end Tag Appears at the end of each Compound tag

§

Byte(u8)

A single byte

§

Short(i16)

A single short

§

Int(i32)

A single int

§

Long(i64)

A single long

§

Float(f32)

A single float

§

Double(f64)

A single double

§

ByteArray(NbtArray<u8>)

An array of bytes

§

String(String)

A string

§

List(NbtList)

A list of Tags of the same type

§

Compound(NbtCompound)

A compound tag

§

IntArray(NbtArray<i32>)

An array of ints

§

LongArray(NbtArray<i64>)

An array of longs

§

FloatArray(NbtArray<f32>)

An array of floats

§

DoubleArray(NbtArray<f64>)

An array of doubles

§

Uuid(UUID)

A UUID

Implementations§

Source§

impl NbtTag

Source

pub fn tag_type(&self) -> TagType

Gets the type of the tag

Source

pub fn default_for_tag(ty: TagType) -> Self

Returns a default (empty) value for the given tag type

Panics if TagType is not a valid tag

Trait Implementations§

Source§

impl Clone for NbtTag

Source§

fn clone(&self) -> NbtTag

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 NbtTag

Source§

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

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

impl Deserializeable for NbtTag

Source§

fn deserialize<W: DataInput + ?Sized>(&mut self, output: &mut W) -> Result<()>

Deserializes the bytes on the stream and stores the result in self or returns an error
Source§

impl Serializeable for NbtTag

Source§

fn serialize<W: DataOutput + ?Sized>(&self, output: &mut W) -> Result<()>

Serializes the type to the stream

Auto Trait Implementations§

§

impl Freeze for NbtTag

§

impl RefUnwindSafe for NbtTag

§

impl Send for NbtTag

§

impl Sync for NbtTag

§

impl Unpin for NbtTag

§

impl UnwindSafe for NbtTag

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, 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.