Enum fastnbt::Value [−][src]
pub enum Value {
Byte(i8),
Short(i16),
Int(i32),
Long(i64),
Double(f64),
Float(f32),
String(String),
ByteArray(ByteArray),
IntArray(IntArray),
LongArray(LongArray),
List(Vec<Value>),
Compound(HashMap<String, Value>),
}
Expand description
Value is a complete NBT value. It owns its data. Compounds and Lists are resursively deserialized. This type takes care to preserve all the information from the original NBT, with the exception of the name of the root compound (which is usually the empty string).
let compound: HashMap<String, Value> = fastnbt::de::from_bytes(buf.as_slice())?;
match compound["DataVersion"] {
Value::Int(ver) => println!("Version: {}", ver),
_ => {},
}
println!("{:#?}", compound);
Variants
Byte(i8)
Tuple Fields
0: i8
Short(i16)
Tuple Fields
0: i16
Int(i32)
Tuple Fields
0: i32
Long(i64)
Tuple Fields
0: i64
Double(f64)
Tuple Fields
0: f64
Float(f32)
Tuple Fields
0: f32
String(String)
Tuple Fields
0: String
ByteArray(ByteArray)
Tuple Fields
0: ByteArray
IntArray(IntArray)
Tuple Fields
0: IntArray
LongArray(LongArray)
Tuple Fields
0: LongArray
List(Vec<Value>)
Compound(HashMap<String, Value>)
Trait Implementations
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
Auto Trait Implementations
impl RefUnwindSafe for Value
impl UnwindSafe for Value
Blanket Implementations
Mutably borrows from an owned value. Read more