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>),
LongArray(Vec<i64>),
}
Expand description
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>)
LongArray(Vec<i64>)
Implementations§
source§impl Value
impl Value
sourcepub fn id(&self) -> i8
pub fn id(&self) -> i8
The type ID of this Value
, which is a single byte in the range
0x01
to 0x0b
.
sourcepub fn to_writer<W>(&self, dst: &mut W, endian: Endianness) -> Result<()>where
W: Write,
pub fn to_writer<W>(&self, dst: &mut W, endian: Endianness) -> Result<()>where
W: Write,
Writes the payload of this Value
to an io::Write
destination.
sourcepub fn from_reader<R>(id: i8, src: &mut R, endian: Endianness) -> Result<Value>where
R: Read,
pub fn from_reader<R>(id: i8, src: &mut R, endian: Endianness) -> Result<Value>where
R: Read,
Reads the payload of an Value
with a given type ID from an
io::Read
source.
pub fn print(&self, f: &mut Formatter<'_>, offset: usize) -> Result
Trait Implementations§
source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more