Enum nbt::Value
[−]
[src]
pub enum Value { Byte(i8), Short(i16), Int(i32), Long(i64), Float(f32), Double(f64), ByteArray(Vec<i8>), String(String), List(Vec<Value>), Compound(HashMap<String, Value>), IntArray(Vec<i32>), }
Values which can be represented in the Named Binary Tag format.
Variants
Byte(i8)
Short(i16)
Int(i32)
Long(i64)
Float(f32)
Double(f64)
ByteArray(Vec<i8>)
String(String)
List(Vec<Value>)
Compound(HashMap<String, Value>)
IntArray(Vec<i32>)
Methods
impl Value
[src]
fn id(&self) -> u8
The type ID of this Value
, which is a single byte in the range
0x01
to 0x0b
.
fn len(&self) -> usize
The length of the payload of this Value
, in bytes.
fn write_header(&self, dst: &mut Write, title: &str) -> Result<()>
Writes the header (that is, the value's type ID and optionally a title)
of this Value
to an io::Write
destination.
fn write(&self, dst: &mut Write) -> Result<()>
Writes the payload of this Value
to an io::Write
destination.
fn read_header(src: &mut Read) -> Result<(u8, String)>
Reads any valid Value
header (that is, a type ID and a title of
arbitrary UTF-8 bytes) from an io::Read
source.
fn from_reader(id: u8, src: &mut Read) -> Result<Value>
Reads the payload of an Value
with a given type ID from an
io::Read
source.
Trait Implementations
impl PartialEq for Value
[src]
fn eq(&self, __arg_0: &Value) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Value) -> bool
This method tests for !=
.
impl Debug for Value
[src]
impl Clone for Value
[src]
fn clone(&self) -> Value
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more