Trait nbt_lib::traits::NbtRead

source ·
pub trait NbtRead {
    // Required methods
    fn read_i8_array(reader: &mut NbtReader) -> NbtResult<Vec<i8>>;
    fn read_i32_array(reader: &mut NbtReader) -> NbtResult<Vec<i32>>;
    fn read_i64_array(reader: &mut NbtReader) -> NbtResult<Vec<i64>>;
    fn read_nbt_string(reader: &mut NbtReader) -> NbtResult<String>;
    fn read_list(reader: &mut NbtReader) -> NbtResult<Vec<NbtValue>>;
    fn read_compound(
        reader: &mut NbtReader
    ) -> NbtResult<HashMap<String, NbtValue>>;
    fn from_reader(reader: NbtReader) -> NbtResult<NbtValue>;
    fn from_reader_text_component(reader: NbtReader) -> NbtResult<NbtValue>;
}
Expand description

trait for every type that has to be read as NBT data

Required Methods§

source

fn read_i8_array(reader: &mut NbtReader) -> NbtResult<Vec<i8>>

function to read a signed 8-bit integer array

§Arguments

reader - A mutable reference to NbtReader

§Returns

Returns a Result with the value of an Error, why the read failed

source

fn read_i32_array(reader: &mut NbtReader) -> NbtResult<Vec<i32>>

function to read a signed 32-bit integer array

§Arguments

reader - A mutable reference to NbtReader

§Returns

Returns a Result with the value of an Error, why the read failed

source

fn read_i64_array(reader: &mut NbtReader) -> NbtResult<Vec<i64>>

function to read a signed 64-bit integer array

§Arguments

reader - A mutable reference to NbtReader

§Returns

Returns a Result with the value of an Error, why the read failed

source

fn read_nbt_string(reader: &mut NbtReader) -> NbtResult<String>

function to read a string

§Arguments

reader - A mutable reference to NbtReader

§Returns

Returns a Result with the value of an Error, why the read failed

source

fn read_list(reader: &mut NbtReader) -> NbtResult<Vec<NbtValue>>

function to read a list of nbt values

§Arguments

reader - A mutable reference to NbtReader

§Returns

Returns a Result with the value of an Error, why the read failed

source

fn read_compound(reader: &mut NbtReader) -> NbtResult<HashMap<String, NbtValue>>

function to read a list of named nbt values

§Arguments

reader - A mutable reference to NbtReader

§Returns

Returns a Result with the value of an Error, why the read failed

source

fn from_reader(reader: NbtReader) -> NbtResult<NbtValue>

function to read nbt data from a NbtReader

§Arguments

reader - A mutable reference to NbtReader

§Returns

Returns a Result with the value of an Error, why the read failed

source

fn from_reader_text_component(reader: NbtReader) -> NbtResult<NbtValue>

function to read a text component from a NbtReader

§Arguments

reader - A mutable reference to NbtReader

§Returns

Returns a Result with the value of an Error, why the read failed

Object Safety§

This trait is not object safe.

Implementors§