Skip to main content

EventTargetMethods

pub trait EventTargetMethods<D: DomTypes> {
    // Required methods
    fn AddEventListener(
        &self,
        type_: DOMString,
        callback: Option<RootedCallback<EventListener<D>>>,
        options: AddEventListenerOptionsOrBoolean<D>,
    );
    fn RemoveEventListener(
        &self,
        type_: DOMString,
        callback: Option<RootedCallback<EventListener<D>>>,
        options: EventListenerOptionsOrBoolean,
    );
    fn DispatchEvent(
        &self,
        cx: &mut JSContext,
        event: &D::Event,
    ) -> Fallible<bool>;
    fn Constructor(
        cx: &mut JSContext,
        global: &D::GlobalScope,
        proto: Option<HandleObject<'_>>,
    ) -> Fallible<DomRoot<D::EventTarget>>;
}

Required Methods§

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§