[−][src]Enum fastnbt::Value
Value is a complete NBT value. It owns it's data. The Byte, Short, Int and
Long NBT types are all deserialized into i64
. Compounds and Lists are
resursively deserialized.
let compound: HashMap<String, Value> = fastnbt::de::from_bytes(buf.as_slice())?; match compound["DataVersion"] { Value::Integral(ver) => println!("Version: {}", ver), _ => {}, } println!("{:#?}", compound);
Variants
Integral(i64)
Any integral value, ie a byte, short, int and long all deserialize to
this type. This simplifies both usage and implementation. If you care
about the exact integral type you may need to write a custom
Deserialise
type with serde. Please also open an issue with your use
case!
Double(f64)
A double. serde distinguishes between f32 and f64, so we do too.
Float(f32)
A float. serde distinguishes between f32 and f64, so we do too.
An array of i64. This will either have been a ByteArray, IntArray or LongArray in the original NBT.
String(String)
A unicode string.
A List of NBT values. Each value may have a different structure/type.
A compound, which is a struct-like object.
Trait Implementations
impl Debug for Value
[src]
impl<'de> Deserialize<'de> for Value
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,