Skip to main content

EventSourceMethods

pub trait EventSourceMethods<D: DomTypes> {
    // Required methods
    fn Url(&self) -> DOMString;
    fn WithCredentials(&self) -> bool;
    fn ReadyState(&self) -> u16;
    fn GetOnopen(
        &self,
        cx: &mut JSContext,
    ) -> Option<RootedCallback<EventHandlerNonNull<D>>>;
    fn SetOnopen(
        &self,
        cx: &mut JSContext,
        value: Option<RootedCallback<EventHandlerNonNull<D>>>,
    );
    fn GetOnmessage(
        &self,
        cx: &mut JSContext,
    ) -> Option<RootedCallback<EventHandlerNonNull<D>>>;
    fn SetOnmessage(
        &self,
        cx: &mut JSContext,
        value: Option<RootedCallback<EventHandlerNonNull<D>>>,
    );
    fn GetOnerror(
        &self,
        cx: &mut JSContext,
    ) -> Option<RootedCallback<EventHandlerNonNull<D>>>;
    fn SetOnerror(
        &self,
        cx: &mut JSContext,
        value: Option<RootedCallback<EventHandlerNonNull<D>>>,
    );
    fn Close(&self);
    fn Constructor(
        cx: &mut JSContext,
        global: &D::GlobalScope,
        proto: Option<HandleObject<'_>>,
        url: DOMString,
        eventSourceInitDict: &EventSourceInit,
    ) -> Fallible<DomRoot<D::EventSource>>;
}

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§