pub trait ComputeStorage: Send {
type Resource: Send;
const ALIGNMENT: u64;
// Required methods
fn get(&mut self, handle: &StorageHandle) -> Self::Resource;
fn alloc(&mut self, size: u64) -> StorageHandle;
fn dealloc(&mut self, id: StorageId);
}
Expand description
Storage types are responsible for allocating and deallocating memory.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn get(&mut self, handle: &StorageHandle) -> Self::Resource
fn get(&mut self, handle: &StorageHandle) -> Self::Resource
Returns the underlying resource for a specified storage handle
Sourcefn alloc(&mut self, size: u64) -> StorageHandle
fn alloc(&mut self, size: u64) -> StorageHandle
Allocates size
units of memory and returns a handle to it
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.