pub trait NbtWrite {
// Required methods
fn write_i8_array(writer: &mut Vec<u8>, data: &[i8]);
fn write_i32_array(writer: &mut Vec<u8>, data: &[i32]);
fn write_i64_array(writer: &mut Vec<u8>, data: &[i64]);
fn write_nbt_string(writer: &mut Vec<u8>, data: &str);
fn write_list(writer: &mut Vec<u8>, data: &[NbtValue]) -> NbtResult<()>;
fn write_compound(
writer: &mut Vec<u8>,
name: Option<&String>,
data: Vec<(&String, &NbtValue)>
) -> NbtResult<()>;
fn write_to(value: &NbtValue, buff: &mut Vec<u8>) -> NbtResult<()>;
fn write_to_with_name(
name: &str,
value: &NbtValue,
buff: &mut Vec<u8>
) -> NbtResult<()>;
fn write_text_component(
writer: &mut Vec<u8>,
value: &NbtValue
) -> NbtResult<()>;
// Provided method
fn to_bytes(value: &NbtValue) -> NbtResult<Vec<u8>> { ... }
}Expand description
Trait for every type that has to be write NBT data
Required Methods§
sourcefn write_i8_array(writer: &mut Vec<u8>, data: &[i8])
fn write_i8_array(writer: &mut Vec<u8>, data: &[i8])
function to write a signed 8-bit integer array
sourcefn write_i32_array(writer: &mut Vec<u8>, data: &[i32])
fn write_i32_array(writer: &mut Vec<u8>, data: &[i32])
function to write a signed 32-bit integer array
sourcefn write_i64_array(writer: &mut Vec<u8>, data: &[i64])
fn write_i64_array(writer: &mut Vec<u8>, data: &[i64])
function to write a signed 64-bit integer array
sourcefn write_nbt_string(writer: &mut Vec<u8>, data: &str)
fn write_nbt_string(writer: &mut Vec<u8>, data: &str)
function to write a string
sourcefn write_list(writer: &mut Vec<u8>, data: &[NbtValue]) -> NbtResult<()>
fn write_list(writer: &mut Vec<u8>, data: &[NbtValue]) -> NbtResult<()>
function to write a list of nbt values
sourcefn write_compound(
writer: &mut Vec<u8>,
name: Option<&String>,
data: Vec<(&String, &NbtValue)>
) -> NbtResult<()>
fn write_compound( writer: &mut Vec<u8>, name: Option<&String>, data: Vec<(&String, &NbtValue)> ) -> NbtResult<()>
function to write a list of named nbt values
sourcefn write_to(value: &NbtValue, buff: &mut Vec<u8>) -> NbtResult<()>
fn write_to(value: &NbtValue, buff: &mut Vec<u8>) -> NbtResult<()>
function to write nbt data to an vector
Provided Methods§
Object Safety§
This trait is not object safe.