sycamore::web

Trait GlobalAttributes

pub trait GlobalAttributes: Sized + SetAttribute {
    // Provided methods
    fn attr(
        self,
        name: &'static str,
        value: impl Into<MaybeDyn<Option<Cow<'static, str>>>>,
    ) -> 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, R>(self, _: E, handler: impl EventHandler<E, R>) -> Self
       where E: EventDescriptor { ... }
    fn bind<E>(
        self,
        _: E,
        signal: Signal<<E as BindDescriptor>::ValueTy>,
    ) -> Self
       where E: BindDescriptor { ... }
}
Expand description

Attributes that are available on all elements.

Provided Methods§

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

Set attribute name with value.

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

Set attribute name with value.

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

Set JS property name with value.

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

Set an event handler with name.

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

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§

§

impl<T> GlobalAttributes for T
where T: GlobalProps,