pub struct DOMMatrixReadOnly(/* private fields */);
Implementations§
Source§impl DOMMatrixReadOnly
impl DOMMatrixReadOnly
pub fn to_string(&self) -> JsString
pub fn to_json(&self) -> JsValue
pub fn to_float64_array(&self) -> Float64Array
pub fn to_float32_array(&self) -> Float32Array
pub fn inverse(&self) -> DOMMatrix
pub fn flip_y(&self) -> DOMMatrix
pub fn flip_x(&self) -> DOMMatrix
pub fn transform_point( &self, point: &dyn ToJs<JsNullable<DOMPointInit>>, ) -> DOMPoint
pub fn skew_y(&self, sy: &dyn ToJs<JsNullable<JsNumber>>) -> DOMMatrix
pub fn skew_x(&self, sx: &dyn ToJs<JsNullable<JsNumber>>) -> DOMMatrix
pub fn multiply(&self, other: &dyn ToJs<JsNullable<DOMMatrixInit>>) -> DOMMatrix
pub fn from_matrix( browser: &Browser, other: &dyn ToJs<JsNullable<DOMMatrixInit>>, ) -> DOMMatrixReadOnly
pub fn from_float64_array( browser: &Browser, array64: &dyn ToJs<Float64Array>, ) -> DOMMatrixReadOnly
pub fn from_float32_array( browser: &Browser, array32: &dyn ToJs<Float32Array>, ) -> DOMMatrixReadOnly
pub fn new( browser: &Browser, init: &dyn ToJs<JsNullable<JsValue>>, ) -> DOMMatrixReadOnly
pub fn scale_non_uniform( &self, scaleX: &dyn ToJs<JsNullable<JsNumber>>, scaleY: &dyn ToJs<JsNullable<JsNumber>>, ) -> DOMMatrix
pub fn rotate_from_vector( &self, x: &dyn ToJs<JsNullable<JsNumber>>, y: &dyn ToJs<JsNullable<JsNumber>>, ) -> DOMMatrix
pub fn translate( &self, tx: &dyn ToJs<JsNullable<JsNumber>>, ty: &dyn ToJs<JsNullable<JsNumber>>, tz: &dyn ToJs<JsNullable<JsNumber>>, ) -> DOMMatrix
pub fn rotate( &self, rotX: &dyn ToJs<JsNullable<JsNumber>>, rotY: &dyn ToJs<JsNullable<JsNumber>>, rotZ: &dyn ToJs<JsNullable<JsNumber>>, ) -> DOMMatrix
pub fn scale3d( &self, scale: &dyn ToJs<JsNullable<JsNumber>>, originX: &dyn ToJs<JsNullable<JsNumber>>, originY: &dyn ToJs<JsNullable<JsNumber>>, originZ: &dyn ToJs<JsNullable<JsNumber>>, ) -> DOMMatrix
pub fn rotate_axis_angle( &self, x: &dyn ToJs<JsNullable<JsNumber>>, y: &dyn ToJs<JsNullable<JsNumber>>, z: &dyn ToJs<JsNullable<JsNumber>>, angle: &dyn ToJs<JsNullable<JsNumber>>, ) -> DOMMatrix
pub fn scale( &self, scaleX: &dyn ToJs<JsNullable<JsNumber>>, scaleY: &dyn ToJs<JsNullable<JsNumber>>, scaleZ: &dyn ToJs<JsNullable<JsNumber>>, originX: &dyn ToJs<JsNullable<JsNumber>>, originY: &dyn ToJs<JsNullable<JsNumber>>, originZ: &dyn ToJs<JsNullable<JsNumber>>, ) -> DOMMatrix
pub fn get_m44(&self) -> JsNumber
pub fn set_m44(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m43(&self) -> JsNumber
pub fn set_m43(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m42(&self) -> JsNumber
pub fn set_m42(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m41(&self) -> JsNumber
pub fn set_m41(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m34(&self) -> JsNumber
pub fn set_m34(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m33(&self) -> JsNumber
pub fn set_m33(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m32(&self) -> JsNumber
pub fn set_m32(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m31(&self) -> JsNumber
pub fn set_m31(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m24(&self) -> JsNumber
pub fn set_m24(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m23(&self) -> JsNumber
pub fn set_m23(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m22(&self) -> JsNumber
pub fn set_m22(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m21(&self) -> JsNumber
pub fn set_m21(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m14(&self) -> JsNumber
pub fn set_m14(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m13(&self) -> JsNumber
pub fn set_m13(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m12(&self) -> JsNumber
pub fn set_m12(&self, value: &dyn ToJs<JsNumber>)
pub fn get_m11(&self) -> JsNumber
pub fn set_m11(&self, value: &dyn ToJs<JsNumber>)
pub fn get_is_identity(&self) -> JsBoolean
pub fn set_is_identity(&self, value: &dyn ToJs<JsBoolean>)
pub fn get_is2_d(&self) -> JsBoolean
pub fn set_is2_d(&self, value: &dyn ToJs<JsBoolean>)
pub fn get_f(&self) -> JsNumber
pub fn set_f(&self, value: &dyn ToJs<JsNumber>)
pub fn get_e(&self) -> JsNumber
pub fn set_e(&self, value: &dyn ToJs<JsNumber>)
pub fn get_d(&self) -> JsNumber
pub fn set_d(&self, value: &dyn ToJs<JsNumber>)
pub fn get_c(&self) -> JsNumber
pub fn set_c(&self, value: &dyn ToJs<JsNumber>)
pub fn get_b(&self) -> JsNumber
pub fn set_b(&self, value: &dyn ToJs<JsNumber>)
pub fn get_a(&self) -> JsNumber
pub fn set_a(&self, value: &dyn ToJs<JsNumber>)
pub fn get_prototype(browser: &Browser) -> DOMMatrixReadOnly
pub fn set_prototype(browser: &Browser, value: &DOMMatrixReadOnly)
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<DOMMatrixReadOnly> for DOMMatrix
impl AsRef<DOMMatrixReadOnly> for DOMMatrix
Source§fn as_ref(&self) -> &DOMMatrixReadOnly
fn as_ref(&self) -> &DOMMatrixReadOnly
Source§impl AsRef<DOMMatrixReadOnly> for DOMMatrixReadOnly
impl AsRef<DOMMatrixReadOnly> for DOMMatrixReadOnly
Source§impl AsRef<JsObject> for DOMMatrixReadOnly
impl AsRef<JsObject> for DOMMatrixReadOnly
Source§impl AsRef<JsValue> for DOMMatrixReadOnly
impl AsRef<JsValue> for DOMMatrixReadOnly
Source§impl Clone for DOMMatrixReadOnly
impl Clone for DOMMatrixReadOnly
Source§fn clone(&self) -> DOMMatrixReadOnly
fn clone(&self) -> DOMMatrixReadOnly
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more