pub(crate) trait WorkerMethods<D: DomTypes> {
// Required methods
fn Terminate(&self);
fn PostMessage(
&self,
cx: SafeJSContext,
message: HandleValue<'_>,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>,
) -> Fallible<()>;
fn PostMessage_(
&self,
cx: SafeJSContext,
message: HandleValue<'_>,
options: RootedTraceableBox<StructuredSerializeOptions>,
) -> Fallible<()>;
fn GetOnmessage(&self) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnmessage(&self, value: Option<Rc<EventHandlerNonNull<D>>>);
fn GetOnmessageerror(&self) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnmessageerror(&self, value: Option<Rc<EventHandlerNonNull<D>>>);
fn GetOnerror(&self) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnerror(&self, value: Option<Rc<EventHandlerNonNull<D>>>);
fn Constructor(
global: &D::GlobalScope,
proto: Option<HandleObject<'_>>,
can_gc: CanGc,
scriptURL: USVString,
options: &WorkerOptions,
) -> Fallible<DomRoot<D::Worker>>;
}
Required Methods§
fn Terminate(&self)
fn PostMessage( &self, cx: SafeJSContext, message: HandleValue<'_>, transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>, ) -> Fallible<()>
fn PostMessage_( &self, cx: SafeJSContext, message: HandleValue<'_>, options: RootedTraceableBox<StructuredSerializeOptions>, ) -> Fallible<()>
fn GetOnmessage(&self) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnmessage(&self, value: Option<Rc<EventHandlerNonNull<D>>>)
fn GetOnmessageerror(&self) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnmessageerror(&self, value: Option<Rc<EventHandlerNonNull<D>>>)
fn GetOnerror(&self) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnerror(&self, value: Option<Rc<EventHandlerNonNull<D>>>)
fn Constructor( global: &D::GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, scriptURL: USVString, options: &WorkerOptions, ) -> Fallible<DomRoot<D::Worker>>
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.