pub trait Allocator:
Clone
+ Send
+ Sync {
type Allocation: Allocation;
type AllocationCreateInfo: AllocationCreateInfo;
// Required methods
fn allocate(
&self,
desc: Self::AllocationCreateInfo,
) -> Result<Self::Allocation>;
fn free(&self, allocation: Self::Allocation) -> Result<()>;
}Expand description
trait for GPU memory allocator.
Required Associated Types§
Required Methods§
Sourcefn allocate(&self, desc: Self::AllocationCreateInfo) -> Result<Self::Allocation>
fn allocate(&self, desc: Self::AllocationCreateInfo) -> Result<Self::Allocation>
Allocate a new memory region.
Sourcefn free(&self, allocation: Self::Allocation) -> Result<()>
fn free(&self, allocation: Self::Allocation) -> Result<()>
Free a memory region.
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.