Struct rquickjs_core::Value
source · pub struct Value<'js> { /* private fields */ }
Expand description
Any javascript value
Implementations§
source§impl<'js> Value<'js>
impl<'js> Value<'js>
pub fn new_uninitialized(ctx: Ctx<'js>) -> Self
pub fn new_undefined(ctx: Ctx<'js>) -> Self
pub fn new_null(ctx: Ctx<'js>) -> Self
sourcepub fn new_number(ctx: Ctx<'js>, value: f64) -> Self
pub fn new_number(ctx: Ctx<'js>, value: f64) -> Self
Create a new number value
pub fn is_null(&self) -> bool
pub fn is_undefined(&self) -> bool
sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Check if the value is a function
source§impl<'js> Value<'js>
impl<'js> Value<'js>
sourcepub unsafe fn ref_string(&self) -> &String<'js>
pub unsafe fn ref_string(&self) -> &String<'js>
sourcepub fn into_string(self) -> Option<String<'js>>
pub fn into_string(self) -> Option<String<'js>>
Try convert into
sourcepub fn from_string(value: String<'js>) -> Self
pub fn from_string(value: String<'js>) -> Self
Convert from
source§impl<'js> Value<'js>
impl<'js> Value<'js>
sourcepub unsafe fn ref_symbol(&self) -> &Symbol<'js>
pub unsafe fn ref_symbol(&self) -> &Symbol<'js>
sourcepub fn into_symbol(self) -> Option<Symbol<'js>>
pub fn into_symbol(self) -> Option<Symbol<'js>>
Try convert into
sourcepub fn from_symbol(value: Symbol<'js>) -> Self
pub fn from_symbol(value: Symbol<'js>) -> Self
Convert from
source§impl<'js> Value<'js>
impl<'js> Value<'js>
sourcepub unsafe fn ref_object(&self) -> &Object<'js>
pub unsafe fn ref_object(&self) -> &Object<'js>
sourcepub fn into_object(self) -> Option<Object<'js>>
pub fn into_object(self) -> Option<Object<'js>>
Try convert into
sourcepub fn from_object(value: Object<'js>) -> Self
pub fn from_object(value: Object<'js>) -> Self
Convert from
source§impl<'js> Value<'js>
impl<'js> Value<'js>
sourcepub fn into_array(self) -> Option<Array<'js>>
pub fn into_array(self) -> Option<Array<'js>>
Try convert into
sourcepub fn from_array(value: Array<'js>) -> Self
pub fn from_array(value: Array<'js>) -> Self
Convert from
source§impl<'js> Value<'js>
impl<'js> Value<'js>
sourcepub unsafe fn ref_function(&self) -> &Function<'js>
pub unsafe fn ref_function(&self) -> &Function<'js>
sourcepub fn as_function(&self) -> Option<&Function<'js>>
pub fn as_function(&self) -> Option<&Function<'js>>
Try reinterprete as
sourcepub fn into_function(self) -> Option<Function<'js>>
pub fn into_function(self) -> Option<Function<'js>>
Try convert into
sourcepub fn from_function(value: Function<'js>) -> Self
pub fn from_function(value: Function<'js>) -> Self
Convert from
source§impl<'js> Value<'js>
impl<'js> Value<'js>
sourcepub unsafe fn ref_big_int(&self) -> &BigInt<'js>
pub unsafe fn ref_big_int(&self) -> &BigInt<'js>
sourcepub fn as_big_int(&self) -> Option<&BigInt<'js>>
pub fn as_big_int(&self) -> Option<&BigInt<'js>>
Try reinterprete as
sourcepub fn into_big_int(self) -> Option<BigInt<'js>>
pub fn into_big_int(self) -> Option<BigInt<'js>>
Try convert into
sourcepub fn from_big_int(value: BigInt<'js>) -> Self
pub fn from_big_int(value: BigInt<'js>) -> Self
Convert from
Trait Implementations§
source§impl<'js> AsRef<Value<'js>> for ArrayBuffer<'js>
impl<'js> AsRef<Value<'js>> for ArrayBuffer<'js>
source§impl<'js, T> AsRef<Value<'js>> for TypedArray<'js, T>
impl<'js, T> AsRef<Value<'js>> for TypedArray<'js, T>
Auto Trait Implementations§
impl<'js> RefUnwindSafe for Value<'js>
impl<'js> Send for Value<'js>
impl<'js> !Sync for Value<'js>
impl<'js> Unpin for Value<'js>
impl<'js> !UnwindSafe for Value<'js>
Blanket Implementations§
source§impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
impl<'js, T> AsProperty<'js, T> for Twhere T: IntoJs<'js>,
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