Trait GlobalAttributes

Source
pub trait GlobalAttributes: SetAttribute + Sized {
    // Provided methods
    fn attr(self, name: &'static str, value: impl Into<StringAttribute>) -> Self { ... }
    fn bool_attr(
        self,
        name: &'static str,
        value: impl Into<MaybeDyn<bool>>,
    ) -> Self { ... }
    fn prop(
        self,
        name: &'static str,
        value: impl Into<MaybeDyn<JsValue>>,
    ) -> Self { ... }
    fn on<E: EventDescriptor, R>(
        self,
        _: E,
        handler: impl EventHandler<E, R>,
    ) -> Self { ... }
    fn bind<E: BindDescriptor>(self, _: E, signal: Signal<E::ValueTy>) -> Self { ... }
}
Expand description

Attributes that are available on all elements.

Provided Methods§

Source

fn attr(self, name: &'static str, value: impl Into<StringAttribute>) -> Self

Set attribute name with value.

Source

fn bool_attr(self, name: &'static str, value: impl Into<MaybeDyn<bool>>) -> Self

Set attribute name with value.

Source

fn prop(self, name: &'static str, value: impl Into<MaybeDyn<JsValue>>) -> Self

Set JS property name with value.

Source

fn on<E: EventDescriptor, R>( self, _: E, handler: impl EventHandler<E, R>, ) -> Self

Set an event handler with name.

Source

fn bind<E: BindDescriptor>(self, _: E, signal: Signal<E::ValueTy>) -> Self

Set a two way binding with name.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§