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§
Provided Methods§
Sourcefn pod_size() -> BufferAddress
fn pod_size() -> BufferAddress
Returns the size in bytes of the POD element.
Sourcefn verify_buffer_size(
buffer: &Buffer,
) -> Result<(), FixedSizeBufferWrapperError>
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.
Sourcefn download_single(
&self,
device: &Device,
queue: &Queue,
) -> impl Future<Output = Result<Self::Pod, DownloadBufferError>> + Send
fn download_single( &self, device: &Device, queue: &Queue, ) -> impl Future<Output = Result<Self::Pod, DownloadBufferError>> + Send
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.