pub enum Value {
Byte(i8),
Short(i16),
Int(i32),
Long(i64),
Float(f32),
Double(f64),
ByteArray(Vec<i8>),
String(String),
List(Vec<Value>),
Compound(Map<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(Map<String, Value>)
IntArray(Vec<i32>)
LongArray(Vec<i64>)
Implementations§
Source§impl Value
impl Value
Sourcepub fn id(&self) -> u8
pub fn id(&self) -> u8
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) -> Result<()>where
W: Write,
pub fn to_writer<W>(&self, dst: &mut W) -> Result<()>where
W: Write,
Writes the payload of this Value
to an io::Write
destination.
Sourcepub fn from_reader<R>(id: u8, src: &mut R) -> Result<Value>where
R: Read,
pub fn from_reader<R>(id: u8, src: &mut R) -> 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
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more