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