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.
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).
pub fn as_list(&self) -> Option<&[Value]>
pub fn as_map(&self) -> Option<&Map>
Trait Implementations§
Source§impl Schema for Value
impl Schema for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more