pub enum ValueRef<'a> {
}Expand description
A borrowed Value: the same cases, strings &'a str, lists and maps slices.
Variants§
Null
Bool(bool)
Int(i64)
Float(f64)
Str(&'a str)
List(&'a [ValueRef<'a>])
Map(MapRef<'a>)
Ref
@item:minecraft:stick.
Tag
@tag:item:minecraft:planks.
Res
@Strings.title.
Lang(&'a str)
@lang:gui.done.
Text(&'a str)
Yog text.
Image(&'a str)
An image source.
Color(u32)
0xAARRGGBB.
Implementations§
Source§impl<'a> ValueRef<'a>
impl<'a> ValueRef<'a>
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<&'a str>
pub fn as_str(&self) -> Option<&'a str>
The string of a Str (and of the string-like typed values: Text, Image).
pub fn as_list(&self) -> Option<&'a [ValueRef<'a>]>
pub fn as_map(&self) -> Option<MapRef<'a>>
Trait Implementations§
impl<'a> Copy for ValueRef<'a>
impl<'a> StructuralPartialEq for ValueRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for ValueRef<'a>
impl<'a> RefUnwindSafe for ValueRef<'a>
impl<'a> Send for ValueRef<'a>
impl<'a> Sync for ValueRef<'a>
impl<'a> Unpin for ValueRef<'a>
impl<'a> UnsafeUnpin for ValueRef<'a>
impl<'a> UnwindSafe for ValueRef<'a>
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