pub struct DedicatedWorkerGlobalScopeState {
pub scope: WorkerGlobalScopeState,
pub worker_id: WorkerId,
pub has_onmessage: bool,
pub has_onerror: bool,
}Expand description
The DedicatedWorkerGlobalScope state tracked by bao_browser.
This struct represents the bao-side view of a Dedicated Worker’s global scope. The actual DOM DedicatedWorkerGlobalScope lives in servo’s ScriptThread; this struct tracks the state that bao needs for lifecycle management, CDP observability, and message routing.
@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]
Fields§
§scope: WorkerGlobalScopeStateThe base WorkerGlobalScope state. @trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope] [entity:WorkerGlobalScope]
worker_id: WorkerIdThe WorkerId identifying this Dedicated Worker. Links the scope to its WorkerHandle and channel bridge. @trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]
has_onmessage: boolWhether onmessage event handler is registered. Tracked for CDP observability (Runtime binding reporting). @trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]
has_onerror: boolWhether onerror event handler is registered. Tracked for CDP observability (Runtime binding reporting). @trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]
Implementations§
Source§impl DedicatedWorkerGlobalScopeState
impl DedicatedWorkerGlobalScopeState
Sourcepub fn new(worker_id: WorkerId, config: &WorkerScopeConfig) -> Self
pub fn new(worker_id: WorkerId, config: &WorkerScopeConfig) -> Self
Create a DedicatedWorkerGlobalScopeState for the given Worker.
@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]
Sourcepub fn location(&self) -> Option<&WorkerLocation>
pub fn location(&self) -> Option<&WorkerLocation>
Get the WorkerLocation for this scope.
@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope] [entity:WorkerLocation]
Get the WorkerNavigator for this scope.
@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope] [entity:WorkerNavigator]
Sourcepub fn set_onmessage(&mut self)
pub fn set_onmessage(&mut self)
Mark onmessage handler as registered.
@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]
Sourcepub fn set_onerror(&mut self)
pub fn set_onerror(&mut self)
Mark onerror handler as registered.
@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]
Trait Implementations§
Source§impl Clone for DedicatedWorkerGlobalScopeState
impl Clone for DedicatedWorkerGlobalScopeState
Source§fn clone(&self) -> DedicatedWorkerGlobalScopeState
fn clone(&self) -> DedicatedWorkerGlobalScopeState
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 DedicatedWorkerGlobalScopeState
impl RefUnwindSafe for DedicatedWorkerGlobalScopeState
impl Send for DedicatedWorkerGlobalScopeState
impl Sync for DedicatedWorkerGlobalScopeState
impl Unpin for DedicatedWorkerGlobalScopeState
impl UnsafeUnpin for DedicatedWorkerGlobalScopeState
impl UnwindSafe for DedicatedWorkerGlobalScopeState
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