[go: up one dir, main page]

[][src]Struct cala_core::os::web::JsVar

pub struct JsVar(_);

A JavaScript variable.

Implementations

impl JsVar[src]

pub unsafe fn into_promise<T: From<JsVar>>(self) -> JsPromise<T>[src]

Assume the JavaScript variable is a promise, and convert to a JsPromise.

pub unsafe fn into_fn(self) -> JsFn[src]

Assuming the JavaScript variable is a function with two parameters, convert into a JsFn.

pub fn from_i32(value: i32) -> JsVar[src]

Create a new JsVar from a Rust integer

pub unsafe fn into_i32(&self) -> i32[src]

Get a Rust integer from a JsVar.

pub fn from_f32(value: f32) -> JsVar[src]

Create a new JsVar from a Rust float

pub unsafe fn into_f32(&self) -> f32[src]

Get a Rust float from a JsVar.

pub fn from_f64(value: f64) -> JsVar[src]

Create a new JsVar from a Rust float

pub unsafe fn into_f64(&self) -> f64[src]

Get a Rust float from a JsVar.

pub unsafe fn read_utf16(&self, output: &mut Vec<u16>)[src]

Assume the variable is a string and copy into Rust Vec.

pub unsafe fn read_bytes(&self, output: &mut Vec<u8>)[src]

Assume the variable is an array and copy into Rust Vec.

pub unsafe fn read_ints(&self, output: &mut Vec<i32>)[src]

Assume the variable is an array and copy into Rust Vec.

pub unsafe fn read_floats(&self, output: &mut Vec<f32>)[src]

Assume the variable is an array and copy into Rust Vec.

pub unsafe fn read_doubles(&self, output: &mut Vec<f64>)[src]

Assume the variable is an array and copy into Rust Vec.

pub unsafe fn write_bytes(&self, input: &[u8])[src]

Assume the variable is an array and copy from Rust slice.

pub unsafe fn write_ints(&self, input: &[i32])[src]

Assume the variable is an array and copy from Rust slice.

pub unsafe fn write_floats(&self, input: &[f32])[src]

Assume the variable is an array and copy from Rust slice.

pub unsafe fn write_doubles(&self, input: &[f64])[src]

Assume the variable is an array and copy from Rust slice.

Trait Implementations

impl Debug for JsVar[src]

impl Drop for JsVar[src]

Auto Trait Implementations

impl RefUnwindSafe for JsVar

impl Send for JsVar

impl Sync for JsVar

impl Unpin for JsVar

impl UnwindSafe for JsVar

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> DynBoxFut<'a> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.