pub enum Val {
}Expand description
a javascript value
Variants§
Undefined
Null
Bool(bool)
Num(f64)
Str(Rc<str>)
Bytes(Rc<[u8]>)
Array(Vec<Val>)
Object(Vec<(Rc<str>, Val)>)
Fn(u32, Rc<str>)
Arena(u32)
Node(u32, u32)
Promise(u32)
Error(Rc<str>)
Output(u32, u32)
a buffer owned by the output registry: id, length of the content
Implementations§
Source§impl Val
impl Val
pub fn str(s: &str) -> Val
pub fn object(entries: Vec<(&str, Val)>) -> Val
pub fn is_nullish(&self) -> bool
pub fn get(&self, key: &str) -> &Val
pub fn num(&self) -> f64
pub fn u32(&self) -> u32
pub fn as_str(&self) -> Option<&str>
pub fn truthy(&self) -> bool
Sourcepub fn to_def(&self) -> HostDef
pub fn to_def(&self) -> HostDef
host definition (options, visitors): the functions are callbacks
pub fn to_plain(&self) -> Plain
pub fn from_plain(plain: &Plain) -> Val
pub fn from_host(value: &HostValue, arena: u32) -> Val
Trait Implementations§
Auto Trait Implementations§
impl !Send for Val
impl !Sync for Val
impl Forget for Val
impl Freeze for Val
impl Move for Val
impl RefUnwindSafe for Val
impl Unpin for Val
impl UnsafeUnpin for Val
impl UnwindSafe for Val
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