Struct DOMMatrixReadOnly

Source
pub struct DOMMatrixReadOnly(/* private fields */);

Implementations§

Source§

impl DOMMatrixReadOnly

Source

pub fn to_string(&self) -> JsString

Source

pub fn to_json(&self) -> JsValue

Source

pub fn to_float64_array(&self) -> Float64Array

Source

pub fn to_float32_array(&self) -> Float32Array

Source

pub fn inverse(&self) -> DOMMatrix

Source

pub fn flip_y(&self) -> DOMMatrix

Source

pub fn flip_x(&self) -> DOMMatrix

Source

pub fn transform_point( &self, point: &dyn ToJs<JsNullable<DOMPointInit>>, ) -> DOMPoint

Source

pub fn skew_y(&self, sy: &dyn ToJs<JsNullable<JsNumber>>) -> DOMMatrix

Source

pub fn skew_x(&self, sx: &dyn ToJs<JsNullable<JsNumber>>) -> DOMMatrix

Source

pub fn multiply(&self, other: &dyn ToJs<JsNullable<DOMMatrixInit>>) -> DOMMatrix

Source

pub fn from_matrix( browser: &Browser, other: &dyn ToJs<JsNullable<DOMMatrixInit>>, ) -> DOMMatrixReadOnly

Source

pub fn from_float64_array( browser: &Browser, array64: &dyn ToJs<Float64Array>, ) -> DOMMatrixReadOnly

Source

pub fn from_float32_array( browser: &Browser, array32: &dyn ToJs<Float32Array>, ) -> DOMMatrixReadOnly

Source

pub fn new( browser: &Browser, init: &dyn ToJs<JsNullable<JsValue>>, ) -> DOMMatrixReadOnly

Source

pub fn scale_non_uniform( &self, scaleX: &dyn ToJs<JsNullable<JsNumber>>, scaleY: &dyn ToJs<JsNullable<JsNumber>>, ) -> DOMMatrix

Source

pub fn rotate_from_vector( &self, x: &dyn ToJs<JsNullable<JsNumber>>, y: &dyn ToJs<JsNullable<JsNumber>>, ) -> DOMMatrix

Source

pub fn translate( &self, tx: &dyn ToJs<JsNullable<JsNumber>>, ty: &dyn ToJs<JsNullable<JsNumber>>, tz: &dyn ToJs<JsNullable<JsNumber>>, ) -> DOMMatrix

Source

pub fn rotate( &self, rotX: &dyn ToJs<JsNullable<JsNumber>>, rotY: &dyn ToJs<JsNullable<JsNumber>>, rotZ: &dyn ToJs<JsNullable<JsNumber>>, ) -> DOMMatrix

Source

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

Source

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

Source

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

Source

pub fn get_m44(&self) -> JsNumber

Source

pub fn set_m44(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m43(&self) -> JsNumber

Source

pub fn set_m43(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m42(&self) -> JsNumber

Source

pub fn set_m42(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m41(&self) -> JsNumber

Source

pub fn set_m41(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m34(&self) -> JsNumber

Source

pub fn set_m34(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m33(&self) -> JsNumber

Source

pub fn set_m33(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m32(&self) -> JsNumber

Source

pub fn set_m32(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m31(&self) -> JsNumber

Source

pub fn set_m31(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m24(&self) -> JsNumber

Source

pub fn set_m24(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m23(&self) -> JsNumber

Source

pub fn set_m23(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m22(&self) -> JsNumber

Source

pub fn set_m22(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m21(&self) -> JsNumber

Source

pub fn set_m21(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m14(&self) -> JsNumber

Source

pub fn set_m14(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m13(&self) -> JsNumber

Source

pub fn set_m13(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m12(&self) -> JsNumber

Source

pub fn set_m12(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_m11(&self) -> JsNumber

Source

pub fn set_m11(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_is_identity(&self) -> JsBoolean

Source

pub fn set_is_identity(&self, value: &dyn ToJs<JsBoolean>)

Source

pub fn get_is2_d(&self) -> JsBoolean

Source

pub fn set_is2_d(&self, value: &dyn ToJs<JsBoolean>)

Source

pub fn get_f(&self) -> JsNumber

Source

pub fn set_f(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_e(&self) -> JsNumber

Source

pub fn set_e(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_d(&self) -> JsNumber

Source

pub fn set_d(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_c(&self) -> JsNumber

Source

pub fn set_c(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_b(&self) -> JsNumber

Source

pub fn set_b(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_a(&self) -> JsNumber

Source

pub fn set_a(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_prototype(browser: &Browser) -> DOMMatrixReadOnly

Source

pub fn set_prototype(browser: &Browser, value: &DOMMatrixReadOnly)

Methods from Deref<Target = JsObject>§

Source

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();
}
Source

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");
}
Source

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).

Source

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>§

Source

pub fn browser(&self) -> &Browser

Source

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

Source§

fn as_ref(&self) -> &DOMMatrixReadOnly

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<DOMMatrixReadOnly> for DOMMatrixReadOnly

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<JsObject> for DOMMatrixReadOnly

Source§

fn as_ref(&self) -> &JsObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<JsValue> for DOMMatrixReadOnly

Source§

fn as_ref(&self) -> &JsValue

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for DOMMatrixReadOnly

Source§

fn clone(&self) -> DOMMatrixReadOnly

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Deref for DOMMatrixReadOnly

Source§

type Target = JsObject

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Into<DOMMatrixReadOnly> for DOMMatrix

Source§

fn into(self) -> DOMMatrixReadOnly

Converts this type into the (usually inferred) input type.
Source§

impl Into<JsObject> for DOMMatrixReadOnly

Source§

fn into(self) -> JsObject

Converts this type into the (usually inferred) input type.
Source§

impl Into<JsValue> for DOMMatrixReadOnly

Source§

fn into(self) -> JsValue

Converts this type into the (usually inferred) input type.
Source§

impl JsCast for DOMMatrixReadOnly

Source§

fn unchecked_from_js(val: JsValue) -> Self

Source§

fn unchecked_from_js_ref(val: &JsValue) -> &Self

Source§

fn unchecked_into<T>(self) -> T
where T: JsCast,

Source§

fn unchecked_ref<T>(&self) -> &T
where T: JsCast,

Source§

impl RefCast for DOMMatrixReadOnly

Source§

type From = JsValue

Source§

fn ref_cast(_from: &Self::From) -> &Self

Source§

fn ref_cast_mut(_from: &mut Self::From) -> &mut Self

Source§

impl UseInJsCode for DOMMatrixReadOnly

Source§

fn serialize_to(&self, buf: &mut Formatter<'_>) -> Result

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ToJs<T> for T
where T: UseInJsCode + ?Sized,