pub trait BufferPool: Send + Sync {
// Required methods
fn alloc(
&self,
size_bytes: u64,
usage: GpuUsage,
location: GpuMemoryLocation,
) -> Result<GpuBufferHandle, GpuError>;
fn free(&self, handle: GpuBufferHandle);
}Expand description
Simple buffer pool trait; implementations provide recycling.
Required Methods§
fn alloc( &self, size_bytes: u64, usage: GpuUsage, location: GpuMemoryLocation, ) -> Result<GpuBufferHandle, GpuError>
fn free(&self, handle: GpuBufferHandle)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".