Skip to main content

CommandStream

Trait CommandStream 

Source
pub trait CommandStream {
    // Required methods
    fn submit(&mut self);
    fn wait(&mut self);

    // Provided method
    fn submit_and_wait(&mut self) { ... }
}
Expand description

Per-backend command stream.

Implementations are free to be no-ops on synchronous backends (host CPU, WASM): submit runs work eagerly, wait returns immediately.

Required Methods§

Source

fn submit(&mut self)

Submit any pending work to the device (non-blocking).

Source

fn wait(&mut self)

Block until all submitted work has completed.

Provided Methods§

Source

fn submit_and_wait(&mut self)

Convenience: submit followed by wait. Backends may override for a fused fast path (e.g. Metal’s commit + waitUntilCompleted).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§