pub enum Value {
}Expand description
A Yog Data value.
The text form has no syntax of its own for the typed values (Ref,
Tag, Res, Text, Image, Color): they’re written as strings
("@item:minecraft:stick"), so every file stays JSON, and the schema of
a field says which type its string is. The binary form keeps the type.
Variants§
Null
Bool(bool)
Int(i64)
Float(f64)
Str(String)
List(Vec<Value>)
Map(Map)
Ref(Ref)
@item:minecraft:stick — content of some kind, by id.
Tag(Ref)
@tag:item:minecraft:planks — a tag of content of some kind.
Res(Res)
@Strings.title — a mod resource (.yres entry).
Lang(String)
@lang:gui.done — a translation key of the game’s or a mod’s lang files.
Text(String)
Yog text: {b|bold} and {#8d6acc|color}.
Image(String)
An image source: sprite:button, mymod:gui/logo, item:minecraft:stick.
Color(u32)
0xAARRGGBB.
Bytes(Vec<u8>)
Bytes as they are — a picture, a sound — written @bytes:<base64> as text.
Implementations§
Source§impl Value
impl Value
pub fn is_null(&self) -> bool
pub fn as_bool(&self) -> Option<bool>
pub fn as_i64(&self) -> Option<i64>
pub fn as_f64(&self) -> Option<f64>
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
The string of a Str (and of the string-like typed values: Text, Image).