[−][src]Enum jrsonnet_evaluator::Val
Variants
Bool(bool)
Num(f64)
Lazy(LazyVal)
Obj(ObjValue)
Implementations
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 try_cast_bool(self, context: &'static str) -> Result<bool>
[src]
pub fn try_cast_str(self, context: &'static str) -> Result<Rc<str>>
[src]
pub fn try_cast_num(self, context: &'static str) -> Result<f64>
[src]
pub fn inplace_unwrap(&mut self) -> Result<()>
[src]
pub fn unwrap_if_lazy(&self) -> Result<Self>
[src]
pub fn value_type(&self) -> Result<ValType>
[src]
pub fn to_string(&self) -> Result<Rc<str>>
[src]
pub fn manifest_multi(
&self,
ty: &ManifestFormat
) -> Result<Vec<(Rc<str>, Rc<str>)>>
[src]
&self,
ty: &ManifestFormat
) -> Result<Vec<(Rc<str>, Rc<str>)>>
Expects value to be object, outputs (key, manifested value) pairs
pub fn manifest_stream(&self, ty: &ManifestFormat) -> Result<Vec<Rc<str>>>
[src]
Expects value to be array, outputs manifested values
pub fn manifest(&self, ty: &ManifestFormat) -> Result<Rc<str>>
[src]
pub fn to_json(&self, padding: usize) -> Result<Rc<str>>
[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<Rc<str>>
[src]
Trait Implementations
impl Clone for Val
[src]
impl Debug for Val
[src]
impl<'_> From<&'_ Value> for Val
[src]
impl<'_> TryFrom<&'_ Val> for Value
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Val
impl !Send for Val
impl !Sync for Val
impl Unpin for Val
impl !UnwindSafe for Val
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,