Function valence::nbt::snbt::from_snbt_str

pub fn from_snbt_str(snbt: &str) -> Result<Value, SnbtError>
Expand description

Parse a string in SNBT format into a Value. Assert that the string has no trailing data. SNBT is quite similar to JSON, but with some differences. See the wiki for more information.

ยงExample

use valence_nbt::snbt::from_snbt_str;
use valence_nbt::Value;

let value = from_snbt_str("1f").unwrap();
assert_eq!(value, Value::Float(1.0));