Enum jrsonnet_evaluator::Val [−][src]
pub enum Val { Bool(bool), Null, Str(IStr), Num(f64), Arr(ArrValue), Obj(ObjValue), Func(Rc<FuncVal>), }
Variants
Bool(bool)
Str(IStr)
Num(f64)
Arr(ArrValue)
Obj(ObjValue)
Implementations
impl Val
[src]
impl Val
[src]pub fn new_checked_num(num: f64) -> Result<Self>
[src]
Creates Val::Num
after checking for numeric overflow.
As numbers are f64
, we can just check for their finity.
pub fn assert_type(
&self,
context: &'static str,
val_type: ValType
) -> Result<()>
[src]
&self,
context: &'static str,
val_type: ValType
) -> Result<()>
pub fn unwrap_num(self) -> Result<f64>
[src]
pub fn unwrap_func(self) -> Result<Rc<FuncVal>>
[src]
pub fn try_cast_bool(self, context: &'static str) -> Result<bool>
[src]
pub fn try_cast_str(self, context: &'static str) -> Result<IStr>
[src]
pub fn try_cast_num(self, context: &'static str) -> Result<f64>
[src]
pub const fn value_type(&self) -> ValType
[src]
pub fn to_string(&self) -> Result<IStr>
[src]
pub fn manifest_multi(&self, ty: &ManifestFormat) -> Result<Vec<(IStr, IStr)>>
[src]
Expects value to be object, outputs (key, manifested value) pairs
pub fn manifest_stream(&self, ty: &ManifestFormat) -> Result<Vec<IStr>>
[src]
Expects value to be array, outputs manifested values
pub fn manifest(&self, ty: &ManifestFormat) -> Result<IStr>
[src]
pub fn to_json(&self, padding: usize) -> Result<IStr>
[src]
For manifestification
pub fn to_std_json(&self, padding: usize) -> Result<Rc<str>>
[src]
Calls std.manifestJson
pub fn to_yaml(&self, padding: usize) -> Result<IStr>
[src]
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Val
impl !RefUnwindSafe for Val
impl !UnwindSafe for Val
impl !UnwindSafe for Val