Struct CompoundTag

Source
pub struct CompoundTag {
    pub name: Option<String>,
    /* private fields */
}

Fields§

§name: Option<String>

Implementations§

Source§

impl CompoundTag

Source

pub fn new() -> Self

Source

pub fn named(name: impl ToString) -> Self

Source

pub fn is_empty(&self) -> bool

Source

pub fn contains_key(&self, name: &str) -> bool

Source

pub fn insert(&mut self, name: impl ToString, tag: impl Into<Tag>)

Source

pub fn get<'a, 'b: 'a, T: TryFrom<&'a Tag>>( &'a self, name: &'b str, ) -> Result<T, CompoundTagError<'_>>

Source

pub fn get_mut<'a, 'b, T>( &'a mut self, name: &'b str, ) -> Result<T, CompoundTagError<'_>>
where T: TryFrom<&'a mut Tag, Error = &'a Tag>, 'b: 'a,

Source

pub fn insert_i8(&mut self, name: impl ToString, value: i8)

Source

pub fn get_i8<'a>(&'a self, name: &'a str) -> Result<i8, CompoundTagError<'a>>

Source

pub fn insert_i16(&mut self, name: impl ToString, value: i16)

Source

pub fn get_i16<'a>(&'a self, name: &'a str) -> Result<i16, CompoundTagError<'a>>

Source

pub fn insert_i32(&mut self, name: impl ToString, value: i32)

Source

pub fn get_i32<'a>(&'a self, name: &'a str) -> Result<i32, CompoundTagError<'a>>

Source

pub fn insert_i64(&mut self, name: impl ToString, value: i64)

Source

pub fn get_i64<'a>(&'a self, name: &'a str) -> Result<i64, CompoundTagError<'a>>

Source

pub fn insert_f32(&mut self, name: impl ToString, value: f32)

Source

pub fn get_f32<'a>(&'a self, name: &'a str) -> Result<f32, CompoundTagError<'a>>

Source

pub fn insert_f64(&mut self, name: impl ToString, value: f64)

Source

pub fn get_f64<'a>(&'a self, name: &'a str) -> Result<f64, CompoundTagError<'a>>

Source

pub fn insert_i8_vec(&mut self, name: impl ToString, value: Vec<i8>)

Source

pub fn get_i8_vec<'a>( &'a self, name: &'a str, ) -> Result<&Vec<i8>, CompoundTagError<'a>>

Source

pub fn insert_i32_vec(&mut self, name: impl ToString, value: Vec<i32>)

Source

pub fn get_i32_vec<'a>( &'a self, name: &'a str, ) -> Result<&Vec<i32>, CompoundTagError<'a>>

Source

pub fn insert_i64_vec(&mut self, name: impl ToString, value: Vec<i64>)

Source

pub fn get_i64_vec<'a>( &'a self, name: &'a str, ) -> Result<&Vec<i64>, CompoundTagError<'a>>

Source

pub fn insert_i16_vec( &mut self, name: impl ToString, vec: impl IntoIterator<Item = i16>, )

Source

pub fn get_i16_vec<'a>( &'a self, name: &'a str, ) -> Result<Vec<i16>, CompoundTagError<'a>>

Source

pub fn insert_f32_vec( &mut self, name: impl ToString, vec: impl IntoIterator<Item = f32>, )

Source

pub fn get_f32_vec<'a>( &'a self, name: &'a str, ) -> Result<Vec<f32>, CompoundTagError<'a>>

Source

pub fn insert_f64_vec( &mut self, name: impl ToString, vec: impl IntoIterator<Item = f64>, )

Source

pub fn get_f64_vec<'a>( &'a self, name: &'a str, ) -> Result<Vec<f64>, CompoundTagError<'a>>

Source

pub fn insert_bool(&mut self, name: &str, value: bool)

Source

pub fn get_bool<'a>( &'a self, name: &'a str, ) -> Result<bool, CompoundTagError<'a>>

Source

pub fn insert_str(&mut self, name: impl ToString, value: impl ToString)

Source

pub fn get_str<'a>( &'a self, name: &'a str, ) -> Result<&str, CompoundTagError<'a>>

Source

pub fn insert_compound_tag(&mut self, name: impl ToString, value: CompoundTag)

Source

pub fn get_compound_tag<'a>( &'a self, name: &'a str, ) -> Result<&CompoundTag, CompoundTagError<'a>>

Source

pub fn insert_str_vec( &mut self, name: impl ToString, vec: impl IntoIterator<Item = impl ToString>, )

Source

pub fn get_str_vec<'a>( &'a self, name: &'a str, ) -> Result<Vec<&str>, CompoundTagError<'a>>

Source

pub fn insert_compound_tag_vec( &mut self, name: impl ToString, vec: impl IntoIterator<Item = CompoundTag>, )

Source

pub fn get_compound_tag_vec<'a>( &'a self, name: &'a str, ) -> Result<Vec<&CompoundTag>, CompoundTagError<'a>>

Source

pub fn iter(&self) -> impl DoubleEndedIterator<Item = (&String, &Tag)>

Source

pub fn iter_mut( &mut self, ) -> impl DoubleEndedIterator<Item = (&String, &mut Tag)>

Trait Implementations§

Source§

impl Clone for CompoundTag

Source§

fn clone(&self) -> CompoundTag

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 CompoundTag

Source§

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

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

impl Display for CompoundTag

Source§

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

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

impl From<CompoundTag> for Tag

Source§

fn from(data: CompoundTag) -> Self

Converts to this type from the input type.
Source§

impl<'a> FromIterator<(&'a str, Tag)> for CompoundTag

Source§

fn from_iter<T: IntoIterator<Item = (&'a str, Tag)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<(String, Tag)> for CompoundTag

Source§

fn from_iter<T: IntoIterator<Item = (String, Tag)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl IntoIterator for CompoundTag

Source§

type Item = (String, Tag)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> TryFrom<&'a Tag> for &'a CompoundTag

Source§

type Error = &'a Tag

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

fn try_from(tag: &'a Tag) -> Result<&CompoundTag, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Tag> for &'a mut CompoundTag

Source§

type Error = &'a Tag

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

fn try_from(tag: &'a mut Tag) -> Result<&mut CompoundTag, Self::Error>

Performs the conversion.

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.