[][src]Trait moxie_dom::interfaces::event_target::EventTarget

pub trait EventTarget<Ev>: NodeWrapper where
    Ev: 'static + Event
{ fn on(self, callback: impl FnMut(Ev) + 'static) -> Self { ... } }

EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.

Element, Document, and Window are the most common event targets, but other objects can be event targets, too. For example XMLHttpRequest, AudioNode, AudioContext, and others.

Many event targets (including elements, documents, and windows) also support setting event handlers via onevent properties and attributes.

Note: this trait cannot be implemented outside of this crate.

Provided methods

fn on(self, callback: impl FnMut(Ev) + 'static) -> Self

Declare an event handler on the element.

A guard value is stored as a resulting "effect" of the mutation, and removes the attribute when dropped, to ensure that the attribute is removed when this declaration is no longer referenced in the most recent (moxie::Revision).

Currently this is performed on every Revision, as changes to event handlers don't typically affect the debugging experience and have not yet shown up in performance profiles.

Loading content...

Implementors

impl EventTarget<AfterPrint> for BodyBuilder[src]

impl EventTarget<BeforePrint> for BodyBuilder[src]

impl EventTarget<HashChange> for BodyBuilder[src]

impl EventTarget<Offline> for BodyBuilder[src]

impl EventTarget<Online> for BodyBuilder[src]

impl EventTarget<Storage> for BodyBuilder[src]

impl EventTarget<Unload> for BodyBuilder[src]

impl EventTarget<WebsocketMessage> for BodyBuilder[src]

impl<E> EventTarget<E> for EmbedBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for IframeBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for ObjectBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for ParamBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for PictureBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for SourceBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for ButtonBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for DatalistBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for FieldsetBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for FormBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for InputBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for LabelBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for LegendBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for MeterBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for OptgroupBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for OptionBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for OutputBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for ProgressBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for SelectBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for TextareaBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for DetailsBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for DialogBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for MenuBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for SummaryBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for AreaBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for AudioBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for ImgBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for MapBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for TrackBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for VideoBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for BaseBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for HeadBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for LinkBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for MetaBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for StyleBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for TitleBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for CanvasBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for NoscriptBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for ScriptBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for AddressBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for ArticleBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for AsideBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for FooterBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for H1Builder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for H2Builder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for H3Builder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for H4Builder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for H5Builder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for H6Builder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for HeaderBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for HgroupBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for MainBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for NavBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for SectionBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for BodyBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for HtmlBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for SlotBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for TemplateBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for CaptionBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for ColBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for ColgroupBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for TableBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for TbodyBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for TdBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for TfootBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for ThBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for TheadBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for TrBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for BlockquoteBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for DdBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for DivBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for DlBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for DtBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for FigcaptionBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for FigureBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for HrBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for LiBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for OlBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for PBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for PreBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for UlBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for ABuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for AbbrBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for BBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for BdiBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for BdoBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for BrBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for CiteBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for CodeBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for DataBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for DelBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for DfnBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for EmBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for IBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for InsBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for KbdBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for MarkBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for QBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for RbBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for RpBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for RtBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for RtcBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for RubyBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for SBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for SampBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for SmallBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for SpanBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for StrongBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for SubBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for SupBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for TimeBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for UBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for VarBuilder where
    E: GlobalEvent
[src]

impl<E> EventTarget<E> for WbrBuilder where
    E: GlobalEvent
[src]

Loading content...