Skip to main content

ElementExt

Trait ElementExt 

Source
pub trait ElementExt: AsRef<Element> + Clone {
    // Provided methods
    fn class(&self, c: impl AsRef<str>) -> Self { ... }
    fn bclass(&self, c: impl AsRef<str>, value: bool) -> Self { ... }
    fn attr(&self, name: impl AsRef<str>, value: impl AsRef<str>) -> Self { ... }
    fn iattr(&self, name: impl AsRef<str>, value: impl Into<i32>) -> Self { ... }
    fn battr(&self, name: impl AsRef<str>, value: bool) -> Self { ... }
}

Provided Methods§

Source

fn class(&self, c: impl AsRef<str>) -> Self

Add c to the class list

Source

fn bclass(&self, c: impl AsRef<str>, value: bool) -> Self

Set whether c is in the class list

Source

fn attr(&self, name: impl AsRef<str>, value: impl AsRef<str>) -> Self

Set the attribute name to the specified value

Source

fn iattr(&self, name: impl AsRef<str>, value: impl Into<i32>) -> Self

Set the attribute name to the specified integer value

Source

fn battr(&self, name: impl AsRef<str>, value: bool) -> Self

Set or unset boolean attribute name

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§