Type Alias wgpu::Maintain

source ·
pub type Maintain = Maintain<SubmissionIndex>;
Expand description

Passed to Device::poll to control how and if it should block.

Aliased Type§

enum Maintain {
    WaitForSubmissionIndex(SubmissionIndex),
    Wait,
    Poll,
}

Variants§

§

WaitForSubmissionIndex(SubmissionIndex)

On wgpu-core based backends, block until the given submission has completed execution, and any callbacks have been invoked.

On WebGPU, this has no effect. Callbacks are invoked from the window event loop.

§

Wait

Same as WaitForSubmissionIndex but waits for the most recent submission.

§

Poll

Check the device for a single time without blocking.

Implementations

source§

impl<T> Maintain<T>

source

pub fn wait() -> Maintain<T>

Construct a wait variant

source

pub fn wait_for(submission_index: T) -> Maintain<T>

Construct a WaitForSubmissionIndex variant

source

pub fn is_wait(&self) -> bool

This maintain represents a wait of some kind.

source

pub fn map_index<U, F>(self, func: F) -> Maintain<U>
where F: FnOnce(T) -> U,

Map on the wait index type.

Trait Implementations

source§

impl<T> Clone for Maintain<T>
where T: Clone,

source§

fn clone(&self) -> Maintain<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for Maintain<T>
where T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more