#[repr(u8)]pub enum NbtTag {
}
Expand description
Enum representing the different types of NBT tags. Each variant corresponds to a different type of data that can be stored in an NBT tag.
Variants§
End = 0
Byte(i8)
Short(i16)
Int(i32)
Long(i64)
Float(f32)
Double(f64)
ByteArray(Bytes)
String(String)
List(Vec<NbtTag>)
Compound(NbtCompound)
IntArray(Vec<i32>)
LongArray(Vec<i64>)
Implementations§
source§impl NbtTag
impl NbtTag
sourcepub const fn get_type_id(&self) -> u8
pub const fn get_type_id(&self) -> u8
Returns the numeric id associated with the data type.
pub fn serialize(&self) -> Bytes
pub fn serialize_data(&self) -> Bytes
pub fn deserialize(bytes: &mut impl Buf) -> Result<NbtTag, Error>
pub fn deserialize_data( bytes: &mut impl Buf, tag_id: u8 ) -> Result<NbtTag, Error>
pub fn extract_byte(&self) -> Option<i8>
pub fn extract_short(&self) -> Option<i16>
pub fn extract_int(&self) -> Option<i32>
pub fn extract_long(&self) -> Option<i64>
pub fn extract_float(&self) -> Option<f32>
pub fn extract_double(&self) -> Option<f64>
pub fn extract_bool(&self) -> Option<bool>
pub fn extract_byte_array(&self) -> Option<Bytes>
pub fn extract_string(&self) -> Option<&String>
pub fn extract_list(&self) -> Option<&Vec<NbtTag>>
pub fn extract_compound(&self) -> Option<&NbtCompound>
pub fn extract_int_array(&self) -> Option<&Vec<i32>>
pub fn extract_long_array(&self) -> Option<&Vec<i64>>
Trait Implementations§
source§impl From<NbtCompound> for NbtTag
impl From<NbtCompound> for NbtTag
source§fn from(value: NbtCompound) -> Self
fn from(value: NbtCompound) -> Self
Converts to this type from the input type.
source§impl PartialEq for NbtTag
impl PartialEq for NbtTag
impl StructuralPartialEq for NbtTag
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more