pub trait WorkerGlobalScopeMethods<D: DomTypes> {
Show 34 methods
// Required methods
fn Self_(&self) -> DomRoot<D::WorkerGlobalScope>;
fn Location(&self) -> DomRoot<D::WorkerLocation>;
fn Navigator(&self) -> DomRoot<D::WorkerNavigator>;
fn ImportScripts(
&self,
cx: &mut JSContext,
urls: Vec<TrustedScriptURLOrUSVString<D>>,
) -> Fallible<()>;
fn GetOnerror(
&self,
cx: &mut JSContext,
) -> Option<Rc<OnErrorEventHandlerNonNull<D>>>;
fn SetOnerror(
&self,
cx: &mut JSContext,
value: Option<Rc<OnErrorEventHandlerNonNull<D>>>,
);
fn GetOnlanguagechange(
&self,
cx: &mut JSContext,
) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnlanguagechange(
&self,
cx: &mut JSContext,
value: Option<Rc<EventHandlerNonNull<D>>>,
);
fn GetOnoffline(
&self,
cx: &mut JSContext,
) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnoffline(
&self,
cx: &mut JSContext,
value: Option<Rc<EventHandlerNonNull<D>>>,
);
fn GetOnonline(
&self,
cx: &mut JSContext,
) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnonline(
&self,
cx: &mut JSContext,
value: Option<Rc<EventHandlerNonNull<D>>>,
);
fn GetOnrejectionhandled(
&self,
cx: &mut JSContext,
) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnrejectionhandled(
&self,
cx: &mut JSContext,
value: Option<Rc<EventHandlerNonNull<D>>>,
);
fn GetOnunhandledrejection(
&self,
cx: &mut JSContext,
) -> Option<Rc<EventHandlerNonNull<D>>>;
fn SetOnunhandledrejection(
&self,
cx: &mut JSContext,
value: Option<Rc<EventHandlerNonNull<D>>>,
);
fn Origin(&self) -> USVString;
fn ReportError(&self, cx: &mut JSContext, e: HandleValue<'_>);
fn Btoa(&self, data: DOMString) -> Fallible<DOMString>;
fn Atob(&self, data: DOMString) -> Fallible<DOMString>;
fn SetTimeout(
&self,
cx: &mut JSContext,
handler: TrustedScriptOrStringOrFunction<D>,
timeout: i32,
arguments: Vec<HandleValue<'_>>,
) -> Fallible<i32>;
fn ClearTimeout(&self, handle: i32);
fn SetInterval(
&self,
cx: &mut JSContext,
handler: TrustedScriptOrStringOrFunction<D>,
timeout: i32,
arguments: Vec<HandleValue<'_>>,
) -> Fallible<i32>;
fn ClearInterval(&self, handle: i32);
fn QueueMicrotask(&self, callback: Rc<VoidFunction<D>>);
fn CreateImageBitmap(
&self,
realm: &mut CurrentRealm<'_>,
image: HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmapOrOffscreenCanvasOrCSSStyleValueOrBlobOrImageData<D>,
options: &ImageBitmapOptions,
) -> Rc<D::Promise>;
fn CreateImageBitmap_(
&self,
realm: &mut CurrentRealm<'_>,
image: HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmapOrOffscreenCanvasOrCSSStyleValueOrBlobOrImageData<D>,
sx: i32,
sy: i32,
sw: i32,
sh: i32,
options: &ImageBitmapOptions,
) -> Rc<D::Promise>;
fn StructuredClone(
&self,
cx: &mut JSContext,
value: HandleValue<'_>,
options: RootedTraceableBox<StructuredSerializeOptions>,
rval: MutableHandleValue<'_>,
) -> Fallible<()>;
fn Crypto(&self) -> DomRoot<D::Crypto>;
fn Performance(&self) -> DomRoot<D::Performance>;
fn IsSecureContext(&self) -> bool;
fn TrustedTypes(
&self,
cx: &mut JSContext,
) -> DomRoot<D::TrustedTypePolicyFactory>;
fn Fetch(
&self,
realm: &mut CurrentRealm<'_>,
input: RequestOrUSVString<D>,
init: RootedTraceableBox<RequestInit<D>>,
) -> Rc<D::Promise>;
fn IndexedDB(&self) -> DomRoot<D::IDBFactory>;
}Required Methods§
fn Self_(&self) -> DomRoot<D::WorkerGlobalScope>
fn Location(&self) -> DomRoot<D::WorkerLocation>
fn ImportScripts( &self, cx: &mut JSContext, urls: Vec<TrustedScriptURLOrUSVString<D>>, ) -> Fallible<()>
fn GetOnerror( &self, cx: &mut JSContext, ) -> Option<Rc<OnErrorEventHandlerNonNull<D>>>
fn SetOnerror( &self, cx: &mut JSContext, value: Option<Rc<OnErrorEventHandlerNonNull<D>>>, )
fn GetOnlanguagechange( &self, cx: &mut JSContext, ) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnlanguagechange( &self, cx: &mut JSContext, value: Option<Rc<EventHandlerNonNull<D>>>, )
fn GetOnoffline(&self, cx: &mut JSContext) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnoffline( &self, cx: &mut JSContext, value: Option<Rc<EventHandlerNonNull<D>>>, )
fn GetOnonline(&self, cx: &mut JSContext) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnonline( &self, cx: &mut JSContext, value: Option<Rc<EventHandlerNonNull<D>>>, )
fn GetOnrejectionhandled( &self, cx: &mut JSContext, ) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnrejectionhandled( &self, cx: &mut JSContext, value: Option<Rc<EventHandlerNonNull<D>>>, )
fn GetOnunhandledrejection( &self, cx: &mut JSContext, ) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnunhandledrejection( &self, cx: &mut JSContext, value: Option<Rc<EventHandlerNonNull<D>>>, )
fn Origin(&self) -> USVString
fn ReportError(&self, cx: &mut JSContext, e: HandleValue<'_>)
fn Btoa(&self, data: DOMString) -> Fallible<DOMString>
fn Atob(&self, data: DOMString) -> Fallible<DOMString>
fn SetTimeout( &self, cx: &mut JSContext, handler: TrustedScriptOrStringOrFunction<D>, timeout: i32, arguments: Vec<HandleValue<'_>>, ) -> Fallible<i32>
fn ClearTimeout(&self, handle: i32)
fn SetInterval( &self, cx: &mut JSContext, handler: TrustedScriptOrStringOrFunction<D>, timeout: i32, arguments: Vec<HandleValue<'_>>, ) -> Fallible<i32>
fn ClearInterval(&self, handle: i32)
fn QueueMicrotask(&self, callback: Rc<VoidFunction<D>>)
fn CreateImageBitmap( &self, realm: &mut CurrentRealm<'_>, image: HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmapOrOffscreenCanvasOrCSSStyleValueOrBlobOrImageData<D>, options: &ImageBitmapOptions, ) -> Rc<D::Promise>
fn CreateImageBitmap_( &self, realm: &mut CurrentRealm<'_>, image: HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmapOrOffscreenCanvasOrCSSStyleValueOrBlobOrImageData<D>, sx: i32, sy: i32, sw: i32, sh: i32, options: &ImageBitmapOptions, ) -> Rc<D::Promise>
fn StructuredClone( &self, cx: &mut JSContext, value: HandleValue<'_>, options: RootedTraceableBox<StructuredSerializeOptions>, rval: MutableHandleValue<'_>, ) -> Fallible<()>
fn Crypto(&self) -> DomRoot<D::Crypto>
fn Performance(&self) -> DomRoot<D::Performance>
fn IsSecureContext(&self) -> bool
fn TrustedTypes( &self, cx: &mut JSContext, ) -> DomRoot<D::TrustedTypePolicyFactory>
fn Fetch( &self, realm: &mut CurrentRealm<'_>, input: RequestOrUSVString<D>, init: RootedTraceableBox<RequestInit<D>>, ) -> Rc<D::Promise>
fn IndexedDB(&self) -> DomRoot<D::IDBFactory>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".