FixedSizeBufferWrapper

Trait FixedSizeBufferWrapper 

Source
pub trait FixedSizeBufferWrapper: BufferWrapper + TryFrom<Buffer> {
    type Pod;

    // Provided methods
    fn pod_size() -> BufferAddress { ... }
    fn verify_buffer_size(
        buffer: &Buffer,
    ) -> Result<(), FixedSizeBufferWrapperError> { ... }
    fn download_single(
        &self,
        device: &Device,
        queue: &Queue,
    ) -> impl Future<Output = Result<Self::Pod, DownloadBufferError>> + Send
       where Self: Send + Sync,
             Self::Pod: NoUninit + AnyBitPattern { ... }
}
Expand description

A BufferWrapper with a fixed size that can be validated from a wgpu::Buffer.

Required Associated Types§

Source

type Pod

The POD element type that defines the layout/size.

Provided Methods§

Source

fn pod_size() -> BufferAddress

Returns the size in bytes of the POD element.

Source

fn verify_buffer_size( buffer: &Buffer, ) -> Result<(), FixedSizeBufferWrapperError>

Check if the given buffer matches the expected size.

This is a helper function for implementing TryFrom.

Source

fn download_single( &self, device: &Device, queue: &Queue, ) -> impl Future<Output = Result<Self::Pod, DownloadBufferError>> + Send
where Self: Send + Sync, Self::Pod: NoUninit + AnyBitPattern,

Download a single FixedSizeBufferWrapper::Pod.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§