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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".