Trait OnTargetAttribute

pub trait OnTargetAttribute<E, F, T> {
    type Output;

    // Required method
    fn on_target(self, event: E, cb: F) -> Self::Output;
}
Expand description

Adds an event listener with a typed target to an element definition.

Required Associated Types§

type Output

The type of the element with the new attribute added.

Required Methods§

fn on_target(self, event: E, cb: F) -> Self::Output

Adds an event listener with a typed target to an element definition.

Implementors§

§

impl<El, At, Ch, E, F> OnTargetAttribute<E, F, HtmlElement<El, At, Ch>> for HtmlElement<El, At, Ch>
where El: ElementType + Send, At: Attribute + Send, Ch: RenderHtml + Send, E: EventDescriptor + Send + 'static, <E as EventDescriptor>::EventType: 'static + From<JsValue>, F: FnMut(Targeted<<E as EventDescriptor>::EventType, <HtmlElement<El, At, Ch> as HasElementType>::ElementType>) + 'static,

§

type Output = <HtmlElement<El, At, Ch> as AddAnyAttr>::Output<On<E, Box<dyn FnMut(<E as EventDescriptor>::EventType)>>>