pub struct JsVar(/* private fields */);Expand description
A JavaScript variable.
Implementations§
Source§impl JsVar
impl JsVar
Sourcepub unsafe fn into_promise<T: From<JsVar>>(self) -> JsPromise<T>
pub unsafe fn into_promise<T: From<JsVar>>(self) -> JsPromise<T>
Assume the JavaScript variable is a promise, and convert to a JsPromise.
Sourcepub unsafe fn into_fn(self) -> JsFn
pub unsafe fn into_fn(self) -> JsFn
Assuming the JavaScript variable is a function with two parameters,
convert into a JsFn.
Sourcepub unsafe fn read_utf16(&self, output: &mut Vec<u16>)
pub unsafe fn read_utf16(&self, output: &mut Vec<u16>)
Assume the variable is a string and copy into Rust Vec.
Sourcepub unsafe fn read_bytes(&self, output: &mut Vec<u8>)
pub unsafe fn read_bytes(&self, output: &mut Vec<u8>)
Assume the variable is an array and copy into Rust Vec.
Sourcepub unsafe fn read_ints(&self, output: &mut Vec<i32>)
pub unsafe fn read_ints(&self, output: &mut Vec<i32>)
Assume the variable is an array and copy into Rust Vec.
Sourcepub unsafe fn read_floats(&self, output: &mut Vec<f32>)
pub unsafe fn read_floats(&self, output: &mut Vec<f32>)
Assume the variable is an array and copy into Rust Vec.
Sourcepub unsafe fn read_doubles(&self, output: &mut Vec<f64>)
pub unsafe fn read_doubles(&self, output: &mut Vec<f64>)
Assume the variable is an array and copy into Rust Vec.
Sourcepub unsafe fn write_bytes(&self, input: &[u8])
pub unsafe fn write_bytes(&self, input: &[u8])
Assume the variable is an array and copy from Rust slice.
Sourcepub unsafe fn write_ints(&self, input: &[i32])
pub unsafe fn write_ints(&self, input: &[i32])
Assume the variable is an array and copy from Rust slice.
Sourcepub unsafe fn write_floats(&self, input: &[f32])
pub unsafe fn write_floats(&self, input: &[f32])
Assume the variable is an array and copy from Rust slice.
Sourcepub unsafe fn write_doubles(&self, input: &[f64])
pub unsafe fn write_doubles(&self, input: &[f64])
Assume the variable is an array and copy from Rust slice.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsVar
impl RefUnwindSafe for JsVar
impl Send for JsVar
impl Sync for JsVar
impl Unpin for JsVar
impl UnwindSafe for JsVar
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