pub struct WorkerGlobalScopeState {
pub worker_url: String,
pub closing: bool,
pub location: Option<WorkerLocation>,
pub navigator: WorkerNavigator,
}Expand description
The base Worker global scope state tracked by bao_browser.
This struct represents the bao-side view of a Worker’s WorkerGlobalScope. The actual DOM WorkerGlobalScope lives in servo’s ScriptThread; this struct tracks the state that bao needs for lifecycle management and CDP observability.
@trace REQ-BRW-004 [entity:WorkerGlobalScope]
Fields§
§worker_url: StringThe Worker script URL. @trace REQ-BRW-004 [entity:WorkerGlobalScope]
closing: boolWhether the Worker is closing (mirrors servo’s Worker::closing). @trace REQ-BRW-004 [entity:WorkerGlobalScope]
location: Option<WorkerLocation>The Worker’s location (parsed from worker_url). @trace REQ-BRW-004 [entity:WorkerGlobalScope] [entity:WorkerLocation]
The Worker’s navigator (populated from parent page’s config). @trace REQ-BRW-004 [entity:WorkerGlobalScope] [entity:WorkerNavigator]
Implementations§
Source§impl WorkerGlobalScopeState
impl WorkerGlobalScopeState
Sourcepub fn new(worker_url: String, config: &WorkerScopeConfig) -> Self
pub fn new(worker_url: String, config: &WorkerScopeConfig) -> Self
Create a WorkerGlobalScopeState from a script URL and scope config.
@trace REQ-BRW-004 [entity:WorkerGlobalScope]
Create a WorkerGlobalScopeState from a script URL and shared scope config.
@trace REQ-BRW-004 [entity:WorkerGlobalScope]
Source§impl WorkerGlobalScopeState
impl WorkerGlobalScopeState
Sourcepub fn new_service(
worker_url: String,
config: &ServiceWorkerScopeConfig,
) -> Self
pub fn new_service( worker_url: String, config: &ServiceWorkerScopeConfig, ) -> Self
Create a WorkerGlobalScopeState from a script URL and service scope config.
@trace REQ-BRW-004 [entity:WorkerGlobalScope]
Trait Implementations§
Source§impl Clone for WorkerGlobalScopeState
impl Clone for WorkerGlobalScopeState
Source§fn clone(&self) -> WorkerGlobalScopeState
fn clone(&self) -> WorkerGlobalScopeState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WorkerGlobalScopeState
impl RefUnwindSafe for WorkerGlobalScopeState
impl Send for WorkerGlobalScopeState
impl Sync for WorkerGlobalScopeState
impl Unpin for WorkerGlobalScopeState
impl UnsafeUnpin for WorkerGlobalScopeState
impl UnwindSafe for WorkerGlobalScopeState
Blanket Implementations§
Source§impl<T> AsCtxPtr for Twhere
T: ?Sized,
impl<T> AsCtxPtr for Twhere
T: ?Sized,
Source§fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
self’s address as *mut Self for deferred-task / scopeguard /
ref_guard ctx slots. The closures/trampolines deref it as shared
(&*p) — every method they reach is &self post-R-2, so no write
provenance is required; the *mut spelling is purely to match the
existing DerefOnDrop / HasAutoFlush / RefCount ABI.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more