pub struct Value(/* private fields */);Implementations§
Source§impl Value
impl Value
pub fn nil() -> Self
pub fn is_nil(&self) -> bool
pub fn boolean(value: bool) -> Self
pub fn as_boolean(&self) -> Option<bool>
pub fn number(value: f64) -> Self
pub fn as_number(&self) -> Option<f64>
pub fn string(handle: StringHandle) -> Self
pub fn as_string(&self) -> Option<StringHandle>
pub fn function(handle: FunctionHandle) -> Self
pub fn as_function(&self) -> Option<FunctionHandle>
pub fn native_function(handle: NativeFunctionHandle) -> Self
pub fn as_native_function(&self) -> Option<NativeFunctionHandle>
pub fn closure(handle: ClosureHandle) -> Self
pub fn as_closure(&self) -> Option<ClosureHandle>
pub fn class(handle: ClassHandle) -> Self
pub fn as_class(&self) -> Option<ClassHandle>
pub fn instance(handle: InstanceHandle) -> Self
pub fn as_instance(&self) -> Option<InstanceHandle>
pub fn bound_method(handle: BoundMethodHandle) -> Self
pub fn as_bound_method(&self) -> Option<BoundMethodHandle>
pub fn bound_intrinsic(handle: BoundIntrinsicHandle) -> Self
pub fn as_bound_intrinsic(&self) -> Option<BoundIntrinsicHandle>
pub fn array(handle: ArrayHandle) -> Self
pub fn as_array(&self) -> Option<ArrayHandle>
pub fn object_literal(handle: HashMapHandle) -> Self
pub fn as_object_literal(&self) -> Option<HashMapHandle>
pub fn module(handle: HashMapHandle) -> Self
pub fn as_module(&self) -> Option<HashMapHandle>
pub fn kind(self) -> ValueKind
pub fn is_truthy(&self) -> bool
pub fn print(&self, allocator: &HeapAllocator)
pub fn to_display_string(&self, allocator: &HeapAllocator) -> String
pub fn to_type_string(&self) -> &'static str
pub fn hash(&self) -> u64
Trait Implementations§
impl Copy for Value
impl Eq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe 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