Skip to main content

ServiceWorkerMethods

pub trait ServiceWorkerMethods<D: DomTypes> {
    // Required methods
    fn ScriptURL(&self) -> USVString;
    fn State(&self) -> ServiceWorkerState;
    fn PostMessage(
        &self,
        cx: &mut JSContext,
        message: HandleValue<'_>,
        transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>,
    ) -> Fallible<()>;
    fn PostMessage_(
        &self,
        cx: &mut JSContext,
        message: HandleValue<'_>,
        options: RootedTraceableBox<StructuredSerializeOptions>,
    ) -> Fallible<()>;
    fn GetOnstatechange(
        &self,
        cx: &mut JSContext,
    ) -> Option<Rc<EventHandlerNonNull<D>>>;
    fn SetOnstatechange(
        &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>>>,
    );
}

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§