Skip to main content

WebGPUKeepAlive

Trait WebGPUKeepAlive 

Source
pub trait WebGPUKeepAlive:
    Debug
    + Send
    + Sync {
    // Required method
    fn as_any(&self) -> &dyn Any;
}
Expand description

Owner token kept alongside an OwnedWebGPUExternalTexture. Owns the browser VideoFrame; the producing element boxes its handle as this trait object and a consumer that can link web-sys downcasts via as_any to recover the frame for importExternalTexture. Dropping the box closes the frame. Send so a frame can cross the runner’s worker boundaries like every other domain; on the single-threaded wasm target the concrete owner asserts Send under that contract (the frame never actually crosses a thread), as the D3D11KeepAlive owners do for their COM handles. Sync too, so a tee branch can read it concurrently (M213), under the same single-threaded-wasm / documented-contract rationale.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Recover the concrete owner so a consumer can extract the VideoFrame. Mirrors the raw-pointer access the CUDA / D3D11 domains expose directly; here the payload lives in the owner, so downcast is the route.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§