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<Rc<EventHandlerNonNull<D>>>;
fn SetOnopen(
&self,
cx: &mut JSContext,
value: Option<Rc<EventHandlerNonNull<D>>>,
);
fn GetOnmessage(
&self,
cx: &mut JSContext,
) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnmessage(
&self,
cx: &mut JSContext,
value: Option<Rc<EventHandlerNonNull<D>>>,
);
fn GetOnerror(
&self,
cx: &mut JSContext,
) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnerror(
&self,
cx: &mut JSContext,
value: Option<Rc<EventHandlerNonNull<D>>>,
);
fn Close(&self);
fn Constructor(
global: &D::GlobalScope,
proto: Option<HandleObject<'_>>,
can_gc: CanGc,
url: DOMString,
eventSourceInitDict: &EventSourceInit,
) -> Fallible<DomRoot<D::EventSource>>;
}Required Methods§
fn Url(&self) -> DOMString
fn WithCredentials(&self) -> bool
fn ReadyState(&self) -> u16
fn GetOnopen(&self, cx: &mut JSContext) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnopen( &self, cx: &mut JSContext, value: Option<Rc<EventHandlerNonNull<D>>>, )
fn GetOnmessage(&self, cx: &mut JSContext) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnmessage( &self, cx: &mut JSContext, value: Option<Rc<EventHandlerNonNull<D>>>, )
fn GetOnerror(&self, cx: &mut JSContext) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnerror( &self, cx: &mut JSContext, value: Option<Rc<EventHandlerNonNull<D>>>, )
fn Close(&self)
fn Constructor( global: &D::GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, url: DOMString, eventSourceInitDict: &EventSourceInit, ) -> Fallible<DomRoot<D::EventSource>>
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.