#[non_exhaustive]pub enum DiagnosticsRequest {
Observe {
streams: Vec<DebugStream>,
},
Snapshot(SnapshotRequest),
Metrics,
WaitForIdle,
WindowComposition,
Capture(CaptureRequest),
WebGpuInspect,
WebGpuCapture {
target: String,
},
WebGpuBuffer {
target: String,
offset: u64,
length: Option<u64>,
},
Evaluate {
script: String,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Observe
Fields
streams: Vec<DebugStream>Snapshot(SnapshotRequest)
Metrics
WaitForIdle
WindowComposition
The native window layers which sit outside the renderer’s document.
A renderer capture cannot see whether an opaque platform window or a tinted native glass view was placed behind its transparent root. This response makes that compositor boundary observable without pretending pixels from an unknown desktop prove which native layer produced them.
Capture(CaptureRequest)
Render the current document to an RGBA8 image and return the pixels.
The one question the rest of this protocol cannot answer. A snapshot reports the boxes and colours the engine resolved, which is not the same as what it drew: an element can hold a correct box, a correct computed colour and an accessible role while painting nothing at all. That gap is not hypothetical. An entire icon set rendered blank in a shipping application while every snapshot, every layout box and every accessibility node read exactly right, and no tool in this protocol could see it.
Rendered offscreen rather than read back from the window surface. The protocol requires no swapchain, compositor, or display server; concrete host availability still depends on the renderer backend for that platform.
WebGpuInspect
Inspect page-owned devices, live resources, errors and submitted frames.
Asking renews a ten-second lease for pass and draw bookkeeping. Hosts without a page WebGPU inspector return their unsupported diagnostics error; absence of support is not an empty report.
WebGpuCapture
Copy one page-owned texture or canvas drawing buffer to RGBA8.
target is texture:<label> or canvas:#id. The answer is
DebugResponse::Captured, the same image a document Capture returns.
WebGpuBuffer
Read bytes from one labeled page-owned GPUBuffer.
The target is buffer:
Evaluate
Run a script in the page and return its completion value as JSON.
The same evaluation a page console offers, so an agent driving a
headless page can read state no tree or capture exposes, such as a
media element’s currentTime. Hosts that run no page script answer
with their unsupported diagnostics error.
Trait Implementations§
Source§impl Clone for DiagnosticsRequest
impl Clone for DiagnosticsRequest
Source§impl Debug for DiagnosticsRequest
impl Debug for DiagnosticsRequest
Source§impl<'de> Deserialize<'de> for DiagnosticsRequest
impl<'de> Deserialize<'de> for DiagnosticsRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for DiagnosticsRequest
impl JsonSchema for DiagnosticsRequest
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for DiagnosticsRequest
impl PartialEq for DiagnosticsRequest
Source§impl Serialize for DiagnosticsRequest
impl Serialize for DiagnosticsRequest
impl StructuralPartialEq for DiagnosticsRequest
Auto Trait Implementations§
impl Forget for DiagnosticsRequest
impl Freeze for DiagnosticsRequest
impl Move for DiagnosticsRequest
impl RefUnwindSafe for DiagnosticsRequest
impl Send for DiagnosticsRequest
impl Sync for DiagnosticsRequest
impl Unpin for DiagnosticsRequest
impl UnsafeUnpin for DiagnosticsRequest
impl UnwindSafe for DiagnosticsRequest
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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