pub struct Float64Array(/* private fields */);
Implementations§
Source§impl Float64Array
impl Float64Array
pub fn value_of(&self) -> Float64Array
pub fn to_string(&self) -> JsString
pub fn to_locale_string(&self) -> JsString
pub fn reverse(&self) -> Float64Array
pub fn sort(&self, compareFn: &dyn ToJs<JsNullable<JsValue>>) -> Self
pub fn reduce_right(&self, callbackfn: &dyn ToJs<JsValue>) -> JsNumber
pub fn reduce(&self, callbackfn: &dyn ToJs<JsValue>) -> JsNumber
pub fn join(&self, separator: &dyn ToJs<JsNullable<JsString>>) -> JsString
pub fn from( browser: &Browser, arrayLike: &dyn ToJs<ArrayLike<JsNumber>>, ) -> Float64Array
pub fn of(browser: &Browser, items: &dyn ToJs<Array<JsNumber>>) -> Float64Array
pub fn new(browser: &Browser, array: &dyn ToJs<JsValue>) -> Float64Array
pub fn subarray( &self, begin: &dyn ToJs<JsNullable<JsNumber>>, end: &dyn ToJs<JsNullable<JsNumber>>, ) -> Float64Array
pub fn some( &self, predicate: &dyn ToJs<JsValue>, thisArg: &dyn ToJs<JsNullable<JsValue>>, ) -> JsBoolean
pub fn slice( &self, start: &dyn ToJs<JsNullable<JsNumber>>, end: &dyn ToJs<JsNullable<JsNumber>>, ) -> Float64Array
pub fn set( &self, array: &dyn ToJs<ArrayLike<JsNumber>>, offset: &dyn ToJs<JsNullable<JsNumber>>, ) -> JsNullish
pub fn reduce_right_with_callbackfn_initialValue<U: JsCast>( &self, callbackfn: &dyn ToJs<JsValue>, initialValue: &dyn ToJs<U>, ) -> U
pub fn reduce_with_callbackfn_initialValue<U: JsCast>( &self, callbackfn: &dyn ToJs<JsValue>, initialValue: &dyn ToJs<U>, ) -> U
pub fn map( &self, callbackfn: &dyn ToJs<JsValue>, thisArg: &dyn ToJs<JsNullable<JsValue>>, ) -> Float64Array
pub fn last_index_of( &self, searchElement: &dyn ToJs<JsNumber>, fromIndex: &dyn ToJs<JsNullable<JsNumber>>, ) -> JsNumber
pub fn index_of( &self, searchElement: &dyn ToJs<JsNumber>, fromIndex: &dyn ToJs<JsNullable<JsNumber>>, ) -> JsNumber
pub fn for_each( &self, callbackfn: &dyn ToJs<JsValue>, thisArg: &dyn ToJs<JsNullable<JsValue>>, ) -> JsNullish
pub fn find_index( &self, predicate: &dyn ToJs<JsValue>, thisArg: &dyn ToJs<JsNullable<JsValue>>, ) -> JsNumber
pub fn find( &self, predicate: &dyn ToJs<JsValue>, thisArg: &dyn ToJs<JsNullable<JsValue>>, ) -> JsNullable<JsNumber>
pub fn filter( &self, predicate: &dyn ToJs<JsValue>, thisArg: &dyn ToJs<JsNullable<JsValue>>, ) -> Float64Array
pub fn every( &self, predicate: &dyn ToJs<JsValue>, thisArg: &dyn ToJs<JsNullable<JsValue>>, ) -> JsBoolean
pub fn fill( &self, value: &dyn ToJs<JsNumber>, start: &dyn ToJs<JsNullable<JsNumber>>, end: &dyn ToJs<JsNullable<JsNumber>>, ) -> Self
pub fn copy_within( &self, target: &dyn ToJs<JsNumber>, start: &dyn ToJs<JsNumber>, end: &dyn ToJs<JsNullable<JsNumber>>, ) -> Self
pub fn from_with_arrayLike_mapfn_thisArg<T: JsCast>( browser: &Browser, arrayLike: &dyn ToJs<ArrayLike<T>>, mapfn: &dyn ToJs<JsValue>, thisArg: &dyn ToJs<JsNullable<JsValue>>, ) -> Float64Array
pub fn new_with_buffer_byteOffset_length( browser: &Browser, buffer: &dyn ToJs<ArrayBuffer>, byteOffset: &dyn ToJs<JsNullable<JsNumber>>, length: &dyn ToJs<JsNullable<JsNumber>>, ) -> Float64Array
pub fn get_length(&self) -> JsNumber
pub fn set_length(&self, value: &dyn ToJs<JsNumber>)
pub fn get_byte_offset(&self) -> JsNumber
pub fn set_byte_offset(&self, value: &dyn ToJs<JsNumber>)
pub fn get_byte_length(&self) -> JsNumber
pub fn set_byte_length(&self, value: &dyn ToJs<JsNumber>)
pub fn get_buffer(&self) -> ArrayBuffer
pub fn set_buffer(&self, value: &dyn ToJs<ArrayBuffer>)
pub fn get_bytes__per__element(&self) -> JsNumber
pub fn set_bytes__per__element(&self, value: &dyn ToJs<JsNumber>)
pub fn get_prototype(browser: &Browser) -> Float64Array
pub fn set_prototype(browser: &Browser, value: &Float64Array)
Methods from Deref<Target = JsObject>§
Sourcepub fn js_get_field(&self, property: &dyn UseInJsCode) -> JsValue
pub fn js_get_field(&self, property: &dyn UseInJsCode) -> JsValue
Get a field value of in this object.
WSDOM provides built-in getters so you should use that instead when possible.
Use js_get_field
only when needed
fn example(browser: Browser) {
// you can get `window["location"]["href"]` like this
let href: JsValue = wsdom::dom::location(&browser).js_get_field(&"href");
// but you should use built-in getters instead
let href: JsString = wsdom::dom::location(&browser).get_href();
}
Sourcepub fn js_set_field(&self, property: &dyn UseInJsCode, value: &dyn UseInJsCode)
pub fn js_set_field(&self, property: &dyn UseInJsCode, value: &dyn UseInJsCode)
Set a field value of in this object.
WSDOM provides built-in setters so you should use that instead when possible.
Use js_set_field
only when needed
fn example(browser: Browser) {
// you can set `window["location"]["href"]` like this
wsdom::dom::location(&browser).js_set_field(&"href", &"https://example.com/");
// but you should use built-in setters instead
wsdom::dom::location(&browser).set_href(&"https://example.com");
}
Sourcepub fn js_call_method<'a>(
&'a self,
method_name: &'a str,
args: impl IntoIterator<Item = &'a dyn UseInJsCode>,
last_arg_variadic: bool,
) -> JsValue
pub fn js_call_method<'a>( &'a self, method_name: &'a str, args: impl IntoIterator<Item = &'a dyn UseInJsCode>, last_arg_variadic: bool, ) -> JsValue
Call a method on this object.
Most types in WSDOM already come with safe Rust wrappers for their methods, so you should use those instead.
fn example(browser: &Browser) {
let console = wsdom::dom::console(browser);
// you can call console.log like this
console.js_call_method("log", [&"hello" as &_], false);
// but the better way is to use
wsdom::dom::console(&browser).log(&[&"Hello" as &_]);
}
Be aware that the first argument (method_name
) is NOT escaped.
Set last_arg_variadic
to true
if you want to “spread” the last argument as obj.method(arg1, arg2, ...arg3)
.
Sourcepub fn js_call_self<'a>(
&'a self,
args: impl IntoIterator<Item = &'a dyn UseInJsCode>,
last_arg_variadic: bool,
) -> JsValue
pub fn js_call_self<'a>( &'a self, args: impl IntoIterator<Item = &'a dyn UseInJsCode>, last_arg_variadic: bool, ) -> JsValue
Call this object: obj()
.
Most types in WSDOM already come with safe Rust wrappers for their methods, so you should use those instead.
Methods from Deref<Target = JsValue>§
pub fn browser(&self) -> &Browser
Sourcepub fn retrieve_json(&self) -> RetrieveFuture<'_, Value>
pub fn retrieve_json(&self) -> RetrieveFuture<'_, Value>
Retrive this value from the JS side to the Rust side. Returns Future whose output is a serde_json::Value.
§use wsdom::dom::Browser
§use wsdom::dom::HTMLInputElement;
async fn example(input: &HTMLInputElement) { let _val = input.get_value().retrieve_json().await; }
Trait Implementations§
Source§impl AsRef<Float64Array> for Float64Array
impl AsRef<Float64Array> for Float64Array
Source§impl AsRef<JsObject> for Float64Array
impl AsRef<JsObject> for Float64Array
Source§impl AsRef<JsValue> for Float64Array
impl AsRef<JsValue> for Float64Array
Source§impl Clone for Float64Array
impl Clone for Float64Array
Source§fn clone(&self) -> Float64Array
fn clone(&self) -> Float64Array
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more