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

Required Methods§

Object Safety§

This trait is not object safe.

Implementors§