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) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnstatechange(&self, value: Option<Rc<EventHandlerNonNull<D>>>);
fn GetOnerror(&self) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnerror(&self, value: Option<Rc<EventHandlerNonNull<D>>>);
}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) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnstatechange(&self, value: Option<Rc<EventHandlerNonNull<D>>>)
fn GetOnerror(&self) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnerror(&self, value: Option<Rc<EventHandlerNonNull<D>>>)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".