pub struct WorkerStructuredMessage {
pub message_id: u64,
pub worker_id: WorkerId,
pub direction: WorkerMessageDirection,
pub payload: Option<StructuredClonePayload>,
}Expand description
A structured-clone message crossing the page↔worker boundary.
Carries both the serialized payload and metadata for CDP observability. Each message gets a unique ID for trace correlation.
@trace REQ-BRW-004 [entity:Worker] [criterion:6] DF-WK-4 / DF-WK-5
Fields§
§message_id: u64Unique message ID for CDP trace correlation.
worker_id: WorkerIdWhich Worker this message is associated with.
direction: WorkerMessageDirectionDirection of the message.
payload: Option<StructuredClonePayload>Structured-clone serialized payload (when available from servo). None when only forwarding metadata (e.g., servo handles clone internally).
Implementations§
Source§impl WorkerStructuredMessage
impl WorkerStructuredMessage
Sourcepub fn new(
worker_id: WorkerId,
direction: WorkerMessageDirection,
payload: Option<StructuredClonePayload>,
) -> Self
pub fn new( worker_id: WorkerId, direction: WorkerMessageDirection, payload: Option<StructuredClonePayload>, ) -> Self
Create a new structured message with a unique ID.
@trace REQ-BRW-004 [entity:Worker] [criterion:6]
Sourcepub fn metadata_only(
worker_id: WorkerId,
direction: WorkerMessageDirection,
) -> Self
pub fn metadata_only( worker_id: WorkerId, direction: WorkerMessageDirection, ) -> Self
Create a metadata-only message (no structured-clone payload). Used when servo handles the clone internally and bao only observes.
@trace REQ-BRW-004 [entity:Worker] DF-WK-4 / DF-WK-5
Sourcepub fn with_payload(
worker_id: WorkerId,
direction: WorkerMessageDirection,
data: Vec<u8>,
transferable_count: u32,
) -> Self
pub fn with_payload( worker_id: WorkerId, direction: WorkerMessageDirection, data: Vec<u8>, transferable_count: u32, ) -> Self
Create a message with serialized structured-clone data.
@trace REQ-BRW-004 [entity:Worker] [criterion:6]
Trait Implementations§
Source§impl Clone for WorkerStructuredMessage
impl Clone for WorkerStructuredMessage
Source§fn clone(&self) -> WorkerStructuredMessage
fn clone(&self) -> WorkerStructuredMessage
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 WorkerStructuredMessage
impl RefUnwindSafe for WorkerStructuredMessage
impl Send for WorkerStructuredMessage
impl Sync for WorkerStructuredMessage
impl Unpin for WorkerStructuredMessage
impl UnsafeUnpin for WorkerStructuredMessage
impl UnwindSafe for WorkerStructuredMessage
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