pub struct AlignedBuffer { /* private fields */ }Expand description
A page-aligned heap buffer suitable for DMA and GPU upload.
Implementations§
Source§impl AlignedBuffer
impl AlignedBuffer
Sourcepub fn new(capacity: usize) -> Result<Self>
pub fn new(capacity: usize) -> Result<Self>
Allocates a page-aligned buffer whose size is rounded up to a multiple of four.
§Errors
Returns a validation error when capacity is zero or overflows the
padded allocation size, and a resource exhaustion error on OOM.
Sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Returns the full mutable slice.
Trait Implementations§
Source§impl Debug for AlignedBuffer
impl Debug for AlignedBuffer
Source§impl Drop for AlignedBuffer
impl Drop for AlignedBuffer
impl Send for AlignedBuffer
impl Sync for AlignedBuffer
Auto Trait Implementations§
impl Freeze for AlignedBuffer
impl RefUnwindSafe for AlignedBuffer
impl Unpin for AlignedBuffer
impl UnsafeUnpin for AlignedBuffer
impl UnwindSafe for AlignedBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more