pub enum Value {
Noval,
Null,
Bool(bool),
Num(f64),
Str(String),
List(VList),
Map(VMap),
Func(NativeFn),
Sentinel(&'static Sentinel),
}Variants§
Noval
Null
Bool(bool)
Num(f64)
Str(String)
List(VList)
Map(VMap)
Func(NativeFn)
Sentinel(&'static Sentinel)
Implementations§
Source§impl Value
impl Value
pub fn list(items: Vec<Value>) -> Value
pub fn empty_list() -> Value
pub fn map(entries: OrderedMap<Value>) -> Value
pub fn empty_map() -> Value
pub fn map_of<I: IntoIterator<Item = (String, Value)>>(pairs: I) -> Value
pub fn func<F>(f: F) -> Value
pub fn str<S: Into<String>>(s: S) -> Value
pub fn skip() -> Value
pub fn delete() -> Value
pub fn is_noval(&self) -> bool
pub fn is_null(&self) -> bool
Sourcepub fn is_nullish(&self) -> bool
pub fn is_nullish(&self) -> bool
JS null == val — true for both undefined and JSON null.
pub fn is_skip(&self) -> bool
pub fn is_delete(&self) -> bool
pub fn as_str(&self) -> Option<&str>
pub fn as_bool(&self) -> Option<bool>
pub fn as_num(&self) -> Option<f64>
pub fn as_list(&self) -> Option<&VList>
pub fn as_map(&self) -> Option<&VMap>
pub fn as_func(&self) -> Option<&NativeFn>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl !UnwindSafe for Value
impl Freeze for Value
impl Unpin for Value
impl UnsafeUnpin 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