[][src]Enum nbt::Value

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>),
}

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

impl Value[src]

pub fn id(&self) -> u8[src]

The type ID of this Value, which is a single byte in the range 0x01 to 0x0b.

pub fn tag_name(&self) -> &str[src]

A string representation of this tag.

pub fn to_writer<W>(&self, dst: &mut W) -> Result<()> where
    W: Write
[src]

Writes the payload of this Value to an io::Write destination.

pub fn from_reader<R>(id: u8, src: &mut R) -> Result<Value> where
    R: Read
[src]

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[src]

pub fn len_bytes(&self) -> usize[src]

The number of bytes this value serializes to, before compression

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl<'de> Deserialize<'de> for Value[src]

impl Display for Value[src]

impl<'a> From<&'a [i32]> for Value[src]

impl<'a> From<&'a [i64]> for Value[src]

impl<'a> From<&'a [i8]> for Value[src]

impl<'a> From<&'a str> for Value[src]

impl From<String> for Value[src]

impl From<Vec<i32>> for Value[src]

impl From<Vec<i64>> for Value[src]

impl From<Vec<i8>> for Value[src]

impl From<f32> for Value[src]

impl From<f64> for Value[src]

impl From<i16> for Value[src]

impl From<i32> for Value[src]

impl From<i64> for Value[src]

impl From<i8> for Value[src]

impl PartialEq<Value> for Value[src]

impl Serialize for Value[src]

impl StructuralPartialEq for Value[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.