### Step By in NbtListListIter Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtListListIter.html Creates an iterator starting at the same point, but stepping by the given amount at each iteration. ```rust fn step_by(self, step: usize) -> StepBy where Self: Sized, ``` -------------------------------- ### NbtTag Implementations Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/enum.NbtTag.html Provides methods for interacting with NbtTag variants, including getting tag IDs, writing tags, and converting to/from specific data types. ```APIDOC ## impl NbtTag ### Methods - **id(&self) -> u8**: Get the numerical ID of the tag type. - **write(&self, data: &mut Vec)**: Writes the tag data to a byte vector. ### Type-Specific Accessors (Examples) - **byte(&self) -> Option**: Get the tag as an i8 if it's a Byte variant. - **byte_mut(&mut self) -> Option<&mut i8>**: Get a mutable reference to the i8 if it's a Byte variant. - **into_byte(self) -> Option**: Consume the tag and return the i8 if it's a Byte variant. (Similar accessors exist for Short, Int, Long, Float, Double, ByteArray, String, List, Compound, IntArray, and LongArray.) ### Conversions (Examples) - **impl From<&str> for NbtTag**: Create an NbtTag from a string slice. - **impl From for NbtTag**: Convert an Nbt type into an NbtTag. - **impl From for NbtCompound**: Convert an NbtTag into an NbtCompound (with specific wrapping rules). - **impl From for NbtTag**: Create an NbtTag from an i32. (Other `From` implementations exist for various types.) ``` -------------------------------- ### Get Size Hint for NbtListListIter Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtListListIter.html Returns the bounds on the remaining length of the iterator. ```rust fn size_hint(&self) -> (usize, Option) ``` -------------------------------- ### Get Approximate Length of NbtListListIter Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtListListIter.html A version of Self::len that saturates at 2^24. ```rust pub fn approx_len(&self) -> u32 ``` -------------------------------- ### PartialEq Implementation Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.NbtCompound.html Equality comparison for NbtCompound. ```APIDOC ## fn eq(&self, other: &NbtCompound) -> bool ### Description Tests for equality between two NbtCompound values, used by the == operator. ## fn ne(&self, other: &Rhs) -> bool ### Description Tests for inequality between two values, used by the != operator. ``` -------------------------------- ### Get TypeId for Mutf8Str Source: https://docs.rs/simdnbt/0.10.0/simdnbt/struct.Mutf8Str.html Implements the Any trait for Mutf8Str, providing a method to get the TypeId of the Mutf8Str. ```rust fn type_id(&self) -> TypeId ``` -------------------------------- ### Get Mutf8Str length Source: https://docs.rs/simdnbt/0.10.0/simdnbt/struct.Mutf8Str.html Returns the length of the Mutf8Str in bytes. ```rust pub fn len(&self) -> usize ``` -------------------------------- ### Simdnbt Serialize Derive Macro Source: https://docs.rs/simdnbt/0.10.0/simdnbt/derive.Serialize.html Demonstrates the basic usage of the #[derive(Serialize)] macro provided by simdnbt and lists available attributes. ```APIDOC ## Derive Macro Serialize ### Description This section describes the `#[derive(Serialize)]` macro for the `simdnbt` crate, which allows for automatic serialization of Rust structs and enums into NBT format. ### Method Derive Macro ### Endpoint N/A (Compile-time macro) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```rust #[derive(Serialize)] struct MyData { // Fields will be serialized } ``` ### Response N/A (Compile-time macro) #### Success Response (200) N/A #### Response Example N/A ### Attributes Attributes available to this derive: - `#[simdnbt]` ``` -------------------------------- ### TryFrom and TryInto Implementations Source: https://docs.rs/simdnbt/0.10.0/simdnbt/struct.Mutf8String.html Provides implementations for `TryFrom` and `TryInto` traits, enabling fallible type conversions. ```APIDOC ## impl TryFrom for T ### Description Provides a fallible conversion from type `U` into type `T`. ### Type Alias #### Error `type Error = Infallible` The type returned in the event of a conversion error. This specific implementation uses `Infallible`, indicating that conversion errors are not expected. ### Method #### try_from(value: U) -> Result>::Error> Performs the conversion from `value` of type `U` to type `T`. ## impl TryInto for T ### Description Provides a fallible conversion from type `T` into type `U`. ### Type Alias #### Error `type Error = >::Error` The type returned in the event of a conversion error. This is determined by the `Error` type associated with the `TryFrom` implementation for `U`. ### Method #### try_into(self) -> Result>::Error> Performs the conversion of `self` (type `T`) into type `U`. ``` -------------------------------- ### Get nth Item from NbtListListIter Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtListListIter.html Returns the nth element of the iterator. ```rust fn nth(&mut self, n: usize) -> Option ``` -------------------------------- ### Get Last Item from NbtListListIter Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtListListIter.html Consumes the iterator, returning the last element. ```rust fn last(self) -> Option ``` -------------------------------- ### Clone to Uninit (Experimental) Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html An experimental nightly-only API that performs copy-assignment from self to an uninitialized memory location. Use with caution. ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` -------------------------------- ### RawList::new Source: https://docs.rs/simdnbt/0.10.0/simdnbt/raw_list/struct.RawList.html Constructs a new RawList from a byte slice. ```APIDOC ## pub fn new(data: &'a [u8]) -> Self ### Description Creates a new `RawList` from a byte slice. ### Parameters - **data** (`&'a [u8]`): The byte slice containing the big-endian encoded numbers. ### Returns - `Self`: A new `RawList` instance. ``` -------------------------------- ### Get Next Item from NbtListListIter Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtListListIter.html Advances the iterator and returns the next value. ```rust fn next(&mut self) -> Option ``` -------------------------------- ### NbtList Equality and Serialization Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/enum.NbtList.html Methods for comparing NbtList instances and serializing them using Serde. ```APIDOC ## PartialEq and Serialize for NbtList ### Description Provides equality testing and serialization support for NbtList. ### Methods - eq(&self, other: &NbtList) -> bool: Tests for equality. - ne(&self, other: &Rhs) -> bool: Tests for inequality. - serialize(&self, serializer: S) -> Result: Serializes the NbtList into a Serde serializer. ``` -------------------------------- ### Serialization Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.NbtCompound.html Serialization support for NbtCompound. ```APIDOC ## fn serialize(&self, serializer: S) -> Result ### Description Serializes the NbtCompound value into the provided Serde serializer. ``` -------------------------------- ### Get Mutf8Str as byte slice Source: https://docs.rs/simdnbt/0.10.0/simdnbt/struct.Mutf8Str.html Returns the underlying byte slice representation of the Mutf8Str. ```rust pub fn as_bytes(&self) -> &[u8] ``` -------------------------------- ### NbtList Methods Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/enum.NbtList.html Provides methods for interacting with NbtList instances, such as retrieving specific data types or converting to other NBT structures. ```APIDOC ## impl NbtList ### Methods - **write**(&self, data: &mut Vec) - **id**(&self) -> u8 - Get the numerical ID of the tag type. - **bytes**(&self) -> Option<&[i8]> - **into_bytes**(self) -> Option> - **shorts**(&self) -> Option> - **into_shorts**(self) -> Option> - **ints**(&self) -> Option> - **into_ints**(self) -> Option> - **longs**(&self) -> Option> - **into_longs**(self) -> Option> - **floats**(&self) -> Option> - **into_floats**(self) -> Option> - **doubles**(&self) -> Option> - **into_doubles**(self) -> Option> - **byte_arrays**(&self) -> Option<&[Vec]> - **into_byte_arrays**(self) -> Option>> - **strings**(&self) -> Option<&[Mutf8String]> - **into_strings**(self) -> Option> - **lists**(&self) -> Option<&[NbtList]> - **into_lists**(self) -> Option> - **compounds**(&self) -> Option<&[NbtCompound]> - **into_compounds**(self) -> Option> - **int_arrays**(&self) -> Option<&[Vec]> - **into_int_arrays**(self) -> Option>> - **long_arrays**(&self) -> Option<&[Vec]> - **into_long_arrays**(self) -> Option>> - **as_nbt_tags**(&self) -> Vec ``` -------------------------------- ### Get BaseNbt Name Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Retrieves the name associated with the BaseNbt compound. This name is often an empty string. ```rust pub fn name(&self) -> &Mutf8Str ``` -------------------------------- ### CloneToUninit Trait Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/enum.Nbt.html An experimental nightly-only API for performing copy-assignment from self to a mutable byte pointer. ```APIDOC ## UNSAFE POST /clone_to_uninit ### Description Performs copy-assignment from `self` to `dest`. ### Method POST ### Endpoint /clone_to_uninit ### Parameters #### Path Parameters - **dest** (pointer) - Required - A mutable pointer to the destination memory address. ### Request Body ```json { "source": "value to be cloned" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates successful operation. ``` -------------------------------- ### Get Next Chunk from NbtListListIter Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtListListIter.html Advances the iterator and returns an array containing the next N values. This is a nightly-only experimental API. ```rust fn next_chunk( &mut self, ) -> Result<[Self::Item; N], IntoIter> where Self: Sized, ``` -------------------------------- ### NbtCompoundList Implementations Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtCompoundList.html Details on trait implementations for NbtCompoundList, including Clone, Default, and IntoIterator. ```APIDOC ### impl<'a, 'tape> Clone for NbtCompoundList<'a, 'tape> #### `clone(&self) -> NbtCompoundList<'a, 'tape>` Returns a duplicate of the value. #### `clone_from(&mut self, source: &Self)` Performs copy-assignment from `source`. ### impl<'a, 'tape> Default for NbtCompoundList<'a, 'tape> #### `default() -> NbtCompoundList<'a, 'tape>` Returns the default value for a type. ### impl<'a: 'tape, 'tape> IntoIterator for NbtCompoundList<'a, 'tape> #### `type Item = NbtCompound<'a, 'tape>` The type of the elements being iterated over. #### `type IntoIter = NbtCompoundListIter<'a, 'tape>` Which kind of iterator are we turning this into? #### `into_iter(self) -> Self::IntoIter` Creates an iterator from a value. ### impl PartialEq for NbtCompoundList<'_, '_> #### `eq(&self, other: &Self) -> bool` Tests for `self` and `other` values to be equal. #### `ne(&self, other: &Rhs) -> bool` Tests for `!=`. ``` -------------------------------- ### NbtCompound Trait Implementations Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.NbtCompound.html Details on traits implemented for NbtCompound, including Clone, Debug, Default, Deserialize, and From/Into conversions. ```APIDOC ## Trait Implementations for NbtCompound ### `impl Clone for NbtCompound` #### `clone(&self) -> NbtCompound` - **Description**: Returns a duplicate of the `NbtCompound` value. #### `clone_from(&mut self, source: &Self)` - **Description**: Performs copy-assignment from a source `NbtCompound`. ### `impl Debug for NbtCompound` #### `fmt(&self, f: &mut Formatter<'_>) -> Result` - **Description**: Formats the `NbtCompound` value using the given formatter. ### `impl Default for NbtCompound` #### `default() -> NbtCompound` - **Description**: Returns the default value for `NbtCompound` (an empty compound). ### `impl Deserialize for NbtCompound` #### `from_compound(compound: NbtCompound<'_, '_>) -> Result` - **Description**: Deserializes an `NbtCompound` from another `NbtCompound`. - **Returns**: `Result` #### `from_nbt(nbt: &BaseNbt<'_>) -> Result` - **Description**: Deserializes an `NbtCompound` from a `BaseNbt` structure. - **Returns**: `Result` ### `impl> From<[(K, NbtTag); N]> for NbtCompound` #### `from(a: [(K, NbtTag); N]) -> Self` - **Description**: Converts an array of key-value pairs into an `NbtCompound`. ### `impl From for BaseNbt` #### `from(tag: NbtCompound) -> Self` - **Description**: Converts an `NbtCompound` into a `BaseNbt` structure. ### `impl From for NbtTag` #### `from(c: NbtCompound) -> Self` - **Description**: Converts an `NbtCompound` into an `NbtTag`. ### `impl From for NbtCompound` #### `from(tag: NbtTag) -> Self` - **Description**: Converts an `NbtTag` into an `NbtCompound`. Non-compound tags and compounds with only one empty string key are wrapped in a compound with an empty string key. ### `impl IntoIterator for NbtCompound` - **Description**: Allows iterating over the `NbtCompound`. ``` -------------------------------- ### Get Iterator of Values Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Returns an iterator over the NbtTag values contained within the BaseNbt compound. The iterator yields references to NbtTag. ```rust pub fn values(&self) -> impl Iterator ``` -------------------------------- ### Create New BaseNbt Instance Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Constructs a new BaseNbt instance with a given name and NbtCompound tag. The name can be any type that can be converted into Mutf8String. ```rust pub fn new(name: impl Into, tag: NbtCompound) -> Self ``` -------------------------------- ### Get Iterator of Keys Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Returns an iterator over the names (keys) of all tags present in the BaseNbt compound. The iterator yields references to Mutf8Str. ```rust pub fn keys(&self) -> impl Iterator ``` -------------------------------- ### Get NbtTag by Name Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Retrieves an optional reference to an NbtTag within the BaseNbt compound, identified by its string name. Returns None if the tag is not found. ```rust pub fn get(&self, name: &str) -> Option<&NbtTag> ``` -------------------------------- ### Iterator Aggregation and Comparison Methods Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtListListIter.html Methods for calculating sums, products, or comparing iterators. ```APIDOC ## sum ### Description Sums the elements of an iterator. ## product ### Description Iterates over the entire iterator, multiplying all the elements. ## eq ### Description Determines if the elements of this Iterator are equal to those of another. ### Parameters #### Request Body - **other** (IntoIterator) - Required - The iterator to compare against. ``` -------------------------------- ### PartialEq for RawList Source: https://docs.rs/simdnbt/0.10.0/simdnbt/raw_list/struct.RawList.html Provides equality comparison for RawList. ```APIDOC ## impl<'a, T: PartialEq> PartialEq for RawList<'a, T> ### Methods #### fn eq(&self, other: &RawList<'a, T>) -> bool Tests for `self` and `other` values to be equal. #### fn ne(&self, other: &Rhs) -> bool Tests for `!=`. ``` -------------------------------- ### Get Compound Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of a compound tag by its name. Returns an Option<&NbtCompound> if found and of the correct type, otherwise None. ```rust pub fn compound(&self, name: &str) -> Option<&NbtCompound> ``` -------------------------------- ### Copy for RawList Source: https://docs.rs/simdnbt/0.10.0/simdnbt/raw_list/struct.RawList.html Indicates that RawList can be copied. ```APIDOC ## impl<'a, T: Copy> Copy for RawList<'a, T> (No methods to implement, this is a marker trait.) ``` -------------------------------- ### Get List Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of a list tag by its name. Returns an Option<&NbtList> if found and of the correct type, otherwise None. ```rust pub fn list(&self, name: &str) -> Option<&NbtList> ``` -------------------------------- ### NbtList Trait Implementations Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/enum.NbtList.html Details on the traits implemented for NbtList, including Clone, Debug, Default, and various From implementations for type conversions. ```APIDOC ## Trait Implementations ### impl Clone for NbtList - **clone**(&self) -> NbtList - Returns a duplicate of the value. - **clone_from**(&mut self, source: &Self) ### impl Debug for NbtList - **fmt**(&self, f: &mut Formatter<'_>) -> Result - Formats the value using the given formatter. ### impl Default for NbtList - **default**() -> NbtList - Returns the "default value" for a type. ### impl From<[T; N]> for NbtList - **from**(tags: [T; N]) -> Self - Converts to this type from the input type. ### impl From for NbtTag - **from**(l: NbtList) -> Self - Converts to this type from the input type. ### impl From> for NbtList - **from**(strings: Vec) -> Self - Converts to this type from the input type. ### impl From> for NbtList - **from**(compounds: Vec) -> Self - Converts to this type from the input type. ### impl From> for NbtList - **from**(lists: Vec) -> Self - Converts to this type from the input type. ### impl From> for NbtList - **from**(tags: Vec) -> Self - Convert a Vec of `NbtTag` into an `NbtList`. Items of heterogeneous lists are wrapped in NBT compounds. ### impl From> for NbtList - **from**(strings: Vec) -> Self - Converts to this type from the input type. ### impl From>> for NbtList - **from**(int_arrays: Vec>) -> Self - Converts to this type from the input type. ### impl From>> for NbtList - **from**(long_arrays: Vec>) -> Self - Converts to this type from the input type. ### impl From>> for NbtList - **from**(byte_arrays: Vec>) -> Self - Converts to this type from the input type. ### impl From> for NbtList - **from**(floats: Vec) -> Self - Converts to this type from the input type. ### impl From> for NbtList - **from**(doubles: Vec) -> Self - Converts to this type from the input type. ### impl From> for NbtList - **from**(shorts: Vec) -> Self - Converts to this type from the input type. ``` -------------------------------- ### Implementations of ToNbtTag Source: https://docs.rs/simdnbt/0.10.0/simdnbt/trait.ToNbtTag.html Demonstrates how various types implement the ToNbtTag trait. ```APIDOC ## Implementations on Foreign Types ### impl ToNbtTag for &str Converts a string slice to an NbtTag. ### impl ToNbtTag for bool Converts a boolean to an NbtTag. ### impl ToNbtTag for f32 Converts a 32-bit float to an NbtTag. ### impl ToNbtTag for f64 Converts a 64-bit float to an NbtTag. ### impl ToNbtTag for i8 Converts an 8-bit signed integer to an NbtTag. ### impl ToNbtTag for i16 Converts a 16-bit signed integer to an NbtTag. ### impl ToNbtTag for i32 Converts a 32-bit signed integer to an NbtTag. ### impl ToNbtTag for i64 Converts a 64-bit signed integer to an NbtTag. ### impl ToNbtTag for u8 Converts an 8-bit unsigned integer to an NbtTag. ### impl ToNbtTag for u16 Converts a 16-bit unsigned integer to an NbtTag. ### impl ToNbtTag for u32 Converts a 32-bit unsigned integer to an NbtTag. ### impl ToNbtTag for u64 Converts a 64-bit unsigned integer to an NbtTag. ### impl ToNbtTag for () Converts the unit type to an NbtTag. ### impl ToNbtTag for String Converts a String to an NbtTag. ### impl ToNbtTag for Vec Converts a vector of Strings to an NbtTag. ### impl ToNbtTag for Vec> Converts a vector of optional serializable types to an NbtTag. ### impl ToNbtTag for Vec Converts a vector of serializable types to an NbtTag. ### impl ToNbtTag for Option Converts an optional type that implements ToNbtTag to an NbtTag. #### fn to_nbt_tag(self) -> NbtTag Converts the Option to an NbtTag. #### fn to_optional_nbt_tag(self) -> Option Converts the Option to an Option. ## Implementors ### impl ToNbtTag for Nbt ### impl ToNbtTag for NbtList ### impl ToNbtTag for NbtTag ### impl ToNbtTag for T ``` -------------------------------- ### Get Double Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of a double tag by its name. Returns an Option containing the value if found and of the correct type, otherwise None. ```rust pub fn double(&self, name: &str) -> Option ``` -------------------------------- ### Clone for RawList Source: https://docs.rs/simdnbt/0.10.0/simdnbt/raw_list/struct.RawList.html Provides cloning capabilities for RawList. ```APIDOC ## impl<'a, T: Clone> Clone for RawList<'a, T> ### Methods #### fn clone(&self) -> RawList<'a, T> Returns a duplicate of the value. #### fn clone_from(&mut self, source: &Self) Performs copy-assignment from `source`. ``` -------------------------------- ### Get Float Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of a float tag by its name. Returns an Option containing the value if found and of the correct type, otherwise None. ```rust pub fn float(&self, name: &str) -> Option ``` -------------------------------- ### Iterator Collection and Partitioning Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtListListIter.html Methods for collecting iterator items into collections or partitioning them. ```APIDOC ## by_ref(&mut self) ### Description Creates a “by reference” adapter for this instance of `Iterator`. ### Method `by_ref` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) A mutable reference to the iterator. #### Response Example None ``` ```APIDOC ## collect(self) ### Description Transforms an iterator into a collection. ### Method `collect` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) A collection of the iterator's items. #### Response Example None ``` ```APIDOC ## collect_into(self, collection: &mut E) ### Description Collects all the items from an iterator into a collection. ### Method `collect_into` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) A mutable reference to the extended collection. #### Response Example None ``` ```APIDOC ## partition(self, f: F) ### Description Consumes an iterator, creating two collections from it based on a predicate. ### Method `partition` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) A tuple containing two collections. #### Response Example None ``` ```APIDOC ## is_partitioned

(self, predicate: P) ### Description Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. ### Method `is_partitioned` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) A boolean indicating if the iterator is partitioned. #### Response Example None ``` -------------------------------- ### Get Long Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of a long tag by its name. Returns an Option containing the value if found and of the correct type, otherwise None. ```rust pub fn long(&self, name: &str) -> Option ``` -------------------------------- ### clone_into Method Source: https://docs.rs/simdnbt/0.10.0/simdnbt/struct.Mutf8String.html The `clone_into` method allows for efficient replacement of owned data with borrowed data, typically through cloning. ```APIDOC ## fn clone_into(&self, target: &mut T) ### Description Uses borrowed data to replace owned data, usually by cloning. ### Method `clone_into` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response None ``` -------------------------------- ### Get Integer Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of an integer tag by its name. Returns an Option containing the value if found and of the correct type, otherwise None. ```rust pub fn int(&self, name: &str) -> Option ``` -------------------------------- ### BaseNbt Write Implementation Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.BaseNbt.html Provides functionality to write the BaseNbt data into a byte vector. ```APIDOC ## `write` Method ### Description Writes the NBT data to a mutable byte vector. ### Signature `pub fn write(&self, data: &mut Vec)` ### Parameters - **data** (`&mut Vec`) - The mutable byte vector to write the NBT data into. ``` -------------------------------- ### Get Short Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of a short tag by its name. Returns an Option containing the value if found and of the correct type, otherwise None. ```rust pub fn short(&self, name: &str) -> Option ``` -------------------------------- ### Mutf8Str Methods Source: https://docs.rs/simdnbt/0.10.0/simdnbt/struct.Mutf8Str.html Methods for interacting with Mutf8Str instances, including conversion to and from standard Rust strings and byte slices. ```APIDOC ## Mutf8Str Methods ### Description Provides utility methods for handling MUTF-8 encoded strings. ### Methods - **from_str(s: &str) -> Cow<'_, Mutf8Str>** - Creates a Mutf8Str from a standard string slice. - **to_str(&self) -> Cow<'_, str>** - Attempts to convert MUTF-8 to a UTF-8 string slice. - **to_string_lossy(&self) -> Cow<'_, str>** - Converts MUTF-8 to a string, handling invalid sequences lossily. - **from_slice(slice: &[u8]) -> &Mutf8Str** - Safely converts a byte slice into a Mutf8Str. - **len(&self) -> usize** - Returns the length of the string. - **is_empty(&self) -> bool** - Checks if the string is empty. - **as_bytes(&self) -> &[u8]** - Returns the underlying byte representation. ``` -------------------------------- ### Get Byte Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of a byte tag by its name. Returns an Option containing the value if found and of the correct type, otherwise None. ```rust pub fn byte(&self, name: &str) -> Option ``` -------------------------------- ### NbtList Conversion Methods Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/enum.NbtList.html Methods for converting various vector types into an NbtList instance. ```APIDOC ## From> for NbtList ### Description Converts a vector of primitive types into an NbtList. ### Methods - from(shorts: Vec) -> NbtList - from(ints: Vec) -> NbtList - from(longs: Vec) -> NbtList - from(bytes: Vec) -> NbtList ``` -------------------------------- ### Get String Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of a string tag by its name. Returns an Option<&Mutf8Str> containing the string slice if found and of the correct type, otherwise None. ```rust pub fn string(&self, name: &str) -> Option<&Mutf8Str> ``` -------------------------------- ### NbtCompoundListIter Methods Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtCompoundListIter.html Methods available for the NbtCompoundListIter struct to inspect list properties. ```APIDOC ## NbtCompoundListIter Methods ### len() Returns the number of tags directly in this list. Note: O(n) complexity if list has >= 2^24 items. ### approx_len() Returns the number of tags, saturating at 2^24 for performance. ### is_empty() Returns true if the list contains no elements. ``` -------------------------------- ### Get Long Array Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of a long array tag by its name. Returns an Option<&[i64]> containing the slice if found and of the correct type, otherwise None. ```rust pub fn long_array(&self, name: &str) -> Option<&[i64]> ``` -------------------------------- ### Get Integer Array Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of an integer array tag by its name. Returns an Option<&[i32]> containing the slice if found and of the correct type, otherwise None. ```rust pub fn int_array(&self, name: &str) -> Option<&[i32]> ``` -------------------------------- ### From and Into Traits Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/enum.Nbt.html Facilitates type conversions, allowing conversion from one type to another. ```APIDOC ## POST /from ### Description Returns the argument unchanged. This is the core implementation for the `From for T` trait. ### Method POST ### Endpoint /from ### Parameters #### Request Body - **t** (T) - Required - The value to be converted. ### Request Example ```json { "t": "some_value" } ``` ### Response #### Success Response (200) - **result** (T) - The converted value. ## POST /into ### Description Calls `U::from(self)`. This method facilitates conversion into another type `U` if `U` implements `From`. ### Method POST ### Endpoint /into ### Parameters #### Request Body - **self** (T) - Required - The value to be converted. ### Request Example ```json { "self": "some_value" } ``` ### Response #### Success Response (200) - **result** (U) - The converted value. ``` -------------------------------- ### Get Byte Array Tag Value Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Attempts to retrieve the value of a byte array tag by its name. Returns an Option<&[u8]> containing the slice if found and of the correct type, otherwise None. ```rust pub fn byte_array(&self, name: &str) -> Option<&[u8]> ``` -------------------------------- ### NbtList Trait Implementations Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtList.html Details the trait implementations for the NbtList struct, including Clone, Copy, Debug, PartialEq, and others. ```APIDOC ## Trait Implementations for NbtList ### `impl<'a: 'tape, 'tape> Clone for NbtList<'a, 'tape>` #### `fn clone(&self) -> NbtList<'a, 'tape>` Returns a duplicate of the value. #### `fn clone_from(&mut self, source: &Self)` Performs copy-assignment from `source`. ### `impl Debug for NbtList<'_, '_>` #### `fn fmt(&self, f: &mut Formatter<'_>) -> Result` Formats the value using the given formatter. ### `impl PartialEq for NbtList<'_, '_>` #### `fn eq(&self, other: &Self) -> bool` Tests for `self` and `other` values to be equal. #### `fn ne(&self, other: &Rhs) -> bool` Tests for `!=`. ### `impl<'a: 'tape, 'tape> Copy for NbtList<'a, 'tape>` ### Auto Trait Implementations - `Freeze` - `RefUnwindSafe` - `!Send` - `!Sync` - `Unpin` - `UnsafeUnpin` - `UnwindSafe` ### Blanket Implementations - `Any` - `Borrow` - `BorrowMut` - `CloneToUninit` (Nightly-only experimental) - `From` - `Into` - `ToOwned` - `TryFrom` - `TryInto` ``` -------------------------------- ### StructuralPartialEq for RawList Source: https://docs.rs/simdnbt/0.10.0/simdnbt/raw_list/struct.RawList.html Provides structural partial equality comparison for RawList. ```APIDOC ## impl<'a, T> StructuralPartialEq for RawList<'a, T> (No methods to implement, this is a marker trait.) ``` -------------------------------- ### Iterate over RawList elements (by reference) Source: https://docs.rs/simdnbt/0.10.0/simdnbt/raw_list/struct.RawList.html Implementing `IntoIterator` for `&RawList` allows iterating over the elements of the list by reference. Requires `T` to be `Copy` and `SwappableNumber`. ```rust type Item = T ``` ```rust type IntoIter = IntoIter ``` ```rust fn into_iter(self) -> Self::IntoIter ``` -------------------------------- ### Compare Mutf8Str for inequality Source: https://docs.rs/simdnbt/0.10.0/simdnbt/struct.Mutf8Str.html Implements the ne method for Mutf8Str, enabling inequality comparisons. ```rust fn ne(&self, other: &Rhs) -> bool ``` -------------------------------- ### NbtCompound Methods Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtCompound.html Methods available on the NbtCompound struct for data retrieval and inspection. ```APIDOC ## NbtCompound Methods ### Description Methods to interact with NBT compound data, including retrieving specific tag types, checking for existence, and iterating over contents. ### Methods - **write(&self, data: &mut Vec)** - Writes the compound to the provided byte vector. - **get(&self, name: &str) -> Option** - Retrieves a tag by name. - **contains(&self, name: &str) -> bool** - Checks if a tag exists by name. - **byte/short/int/long/float/double(&self, name: &str) -> Option** - Retrieves numeric values by name. - **byte_array(&self, name: &str) -> Option<&'a [u8]>** - Retrieves a byte array by name. - **string(&self, name: &str) -> Option<&'a Mutf8Str>** - Retrieves a string by name. - **list(&self, name: &str) -> Option** - Retrieves a list by name. - **compound(&self, name: &str) -> Option** - Retrieves a nested compound by name. - **int_array/long_array(&self, name: &str) -> Option>** - Retrieves integer or long arrays by name. - **len(&self) -> usize** - Returns the number of tags in the compound (O(n)). - **is_empty(&self) -> bool** - Returns true if the compound contains no tags. ``` -------------------------------- ### Serialize NBT data Source: https://docs.rs/simdnbt/0.10.0/simdnbt/index.html Construct an owned NBT structure and write it to a buffer. ```rust use simdnbt::owned::{BaseNbt, Nbt, NbtCompound, NbtTag}; let nbt = Nbt::Some(BaseNbt::new( "", NbtCompound::from_values(vec![ ("key".into(), NbtTag::String("value".into())), ]), )); let mut buffer = Vec::new(); nbt.write(&mut buffer); ``` -------------------------------- ### Clone From Another BaseNbt Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Performs copy-assignment from a source BaseNbt instance to the current one. This is an efficient way to update the contents. ```rust fn clone_from(&mut self, source: &Self) ``` -------------------------------- ### FromNbtTag for () Source: https://docs.rs/simdnbt/0.10.0/simdnbt/trait.FromNbtTag.html Implementation of FromNbtTag for the unit type. Converts an NbtTag into an Option<()>. The input tag is ignored. ```rust impl FromNbtTag for () Source§ #### fn from_nbt_tag(_: NbtTag<'_, '_>) -> Option ``` -------------------------------- ### Advance NbtListListIter by n Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtListListIter.html Advances the iterator by n elements. This is a nightly-only experimental API. ```rust fn advance_by(&mut self, n: usize) -> Result<(), NonZero> ``` -------------------------------- ### NbtCompound Accessor Methods Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/enum.Nbt.html Methods for retrieving specific tag types from an NbtCompound. ```APIDOC ## NbtCompound Accessors ### Description Methods to retrieve specific primitive or complex types from an NbtCompound by name. ### Methods - **get(name: &str) -> Option<&NbtTag>** - Retrieves a tag by name. - **contains(name: &str) -> bool** - Checks if a tag exists. - **byte(name: &str) -> Option** - Retrieves an i8 byte. - **short(name: &str) -> Option** - Retrieves an i16 short. - **int(name: &str) -> Option** - Retrieves an i32 integer. - **long(name: &str) -> Option** - Retrieves an i64 long. - **float(name: &str) -> Option** - Retrieves an f32 float. - **double(name: &str) -> Option** - Retrieves an f64 double. - **string(name: &str) -> Option<&Mutf8Str>** - Retrieves a string. - **list(name: &str) -> Option<&NbtList>** - Retrieves a list. - **compound(name: &str) -> Option<&NbtCompound>** - Retrieves a nested compound. ``` -------------------------------- ### FromNbtTag for f64 Source: https://docs.rs/simdnbt/0.10.0/simdnbt/trait.FromNbtTag.html Implementation of FromNbtTag for the f64 floating-point type. Converts an NbtTag into an Option. ```rust impl FromNbtTag for f64 Source§ #### fn from_nbt_tag(tag: NbtTag<'_, '_>) -> Option ``` -------------------------------- ### Function: read Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/fn.read.html Reads a normal root NBT compound from a cursor, returning an Nbt object or an error. ```APIDOC ## read ### Description Reads a normal root NBT compound. This is either empty or has a name and compound tag. Returns `Ok(Nbt::None)` if there is no data. ### Signature `pub fn read<'a>(data: &mut Cursor<&'a [u8]>) -> Result, Error>` ### Parameters #### Path Parameters - **data** (&mut Cursor<&'a [u8]>) - Required - A mutable reference to a cursor containing the NBT byte data. ### Response #### Success Response (Ok) - **Nbt<'a>** - The parsed NBT structure. #### Error Response (Err) - **Error** - An error encountered during the parsing process. ``` -------------------------------- ### Add simdnbt dependency Source: https://docs.rs/simdnbt/0.10.0/simdnbt/index.html Use this command to add the simdnbt crate to your Rust project. ```shell cargo add simdnbt ``` -------------------------------- ### NbtCompound Implementation of Deserialize Source: https://docs.rs/simdnbt/0.10.0/simdnbt/trait.Deserialize.html Details the implementation of the Deserialize trait for the NbtCompound type. ```APIDOC ## Implementors Source ### impl Deserialize for NbtCompound ``` -------------------------------- ### Map items in NbtListListIter Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtListListIter.html Takes a closure and creates an iterator which calls that closure on each element. ```rust fn map(self, f: F) -> Map where Self: Sized, F: FnMut(Self::Item) -> B, ``` -------------------------------- ### HashMap Implementation of Deserialize Source: https://docs.rs/simdnbt/0.10.0/simdnbt/trait.Deserialize.html Details the implementation of the Deserialize trait for the HashMap type. ```APIDOC ## Implementations on Foreign Types Source ### impl Deserialize for HashMap Source #### fn from_compound( compound: NbtCompound<'_, '_>, ) -> Result ``` -------------------------------- ### Iterator Comparison Methods Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtCompoundIter.html Methods for lexicographically comparing iterators. ```APIDOC ## cmp ### Description Lexicographically compares the elements of this Iterator with those of another. ### Parameters - **other** (I) - Required - The iterator to compare against. ### Response - **Ordering** - The result of the comparison. ``` -------------------------------- ### Iterator Adapters Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtCompoundIter.html Methods that create new iterators by adapting the existing one. ```APIDOC ## Iterator Adapters ### `take(n: usize)` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. ### `scan(initial_state: St, f: F)` An iterator adapter which, like `fold`, holds internal state, but unlike `fold`, produces a new iterator. ### `flat_map(f: F)` Creates an iterator that works like map, but flattens nested structure. ### `flatten()` Creates an iterator that flattens nested structure. ### `map_windows(f: F)` 🔬 This is a nightly-only experimental API. (`iter_map_windows`) Calls the given function `f` for each contiguous window of size `N` over `self` and returns an iterator over the outputs of `f`. Like `slice::windows()`, the windows during mapping overlap as well. ### `fuse()` Creates an iterator which ends after the first `None`. ### `inspect(f: F)` Does something with each element of an iterator, passing the value on. ### `by_ref()` Creates a “by reference” adapter for this instance of `Iterator`. ``` -------------------------------- ### FromNbtTag for i64 Source: https://docs.rs/simdnbt/0.10.0/simdnbt/trait.FromNbtTag.html Implementation of FromNbtTag for the i64 integer type. Converts an NbtTag into an Option. ```rust impl FromNbtTag for i64 Source§ #### fn from_nbt_tag(tag: NbtTag<'_, '_>) -> Option ``` -------------------------------- ### TryFrom and TryInto Traits Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/enum.Nbt.html Provides fallible type conversions, allowing for conversions that might fail. ```APIDOC ## POST /try_from ### Description Performs a fallible conversion from type `U` into type `T`. ### Method POST ### Endpoint /try_from ### Parameters #### Request Body - **value** (U) - Required - The value to attempt conversion from. ### Request Example ```json { "value": "some_value_of_u" } ``` ### Response #### Success Response (200) - **result** (Result) - A Result containing either the converted value of type T or an error. #### Error Response (e.g., 400) - **error** (Error) - Description of the conversion error. ## POST /try_into ### Description Performs a fallible conversion from type `T` into type `U`. ### Method POST ### Endpoint /try_into ### Parameters #### Request Body - **self** (T) - Required - The value to attempt conversion from. ### Request Example ```json { "self": "some_value_of_t" } ``` ### Response #### Success Response (200) - **result** (Result) - A Result containing either the converted value of type U or an error. #### Error Response (e.g., 400) - **error** (Error) - Description of the conversion error. ``` -------------------------------- ### Convert NbtCompound to BaseNbt Source: https://docs.rs/simdnbt/0.10.0/simdnbt/owned/struct.BaseNbt.html Implements the From trait, allowing an NbtCompound to be directly converted into a BaseNbt instance. This conversion typically assigns a default or empty name. ```rust fn from(tag: NbtCompound) -> Self ``` -------------------------------- ### Iterator Min/Max Methods Source: https://docs.rs/simdnbt/0.10.0/simdnbt/borrow/struct.NbtCompoundIter.html Methods for finding the minimum or maximum elements in an iterator. ```APIDOC ## max ### Description Returns the maximum element of an iterator. ### Response - **Option** - The maximum element, or None if empty. ``` ```APIDOC ## min ### Description Returns the minimum element of an iterator. ### Response - **Option** - The minimum element, or None if empty. ```