pub trait Allocation: Send + Sync {
// Required methods
fn kind(&self) -> MemoryKind;
fn len_bytes(&self) -> usize;
fn as_ptr(&self) -> NonNull<u8>;
}Expand description
A handle to backend-allocated memory. Concrete backends provide a non-trait struct that derefs to a typed slice for the hot path.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".