pub struct AlignedBufferPool<P: BufferRetentionPolicy = RetainAllRetentionPolicy, const ALIGNMENT: usize = DEFAULT_BUFFER_ALIGNMENT, A: Allocator + Clone = Global> { /* private fields */ }Expand description
A pool for allocating and recycling aligned buffers.
Implementations§
Source§impl<P, const ALIGNMENT: usize> AlignedBufferPool<P, ALIGNMENT, Global>where
P: Default + BufferRetentionPolicy,
impl<P, const ALIGNMENT: usize> AlignedBufferPool<P, ALIGNMENT, Global>where
P: Default + BufferRetentionPolicy,
Source§impl<P: BufferRetentionPolicy, const ALIGNMENT: usize> AlignedBufferPool<P, ALIGNMENT, Global>
impl<P: BufferRetentionPolicy, const ALIGNMENT: usize> AlignedBufferPool<P, ALIGNMENT, Global>
pub fn with_policy(policy: P, capacity: usize) -> Self
Source§impl<P, const ALIGNMENT: usize, A: Allocator + Clone> AlignedBufferPool<P, ALIGNMENT, A>where
P: Default + BufferRetentionPolicy,
impl<P, const ALIGNMENT: usize, A: Allocator + Clone> AlignedBufferPool<P, ALIGNMENT, A>where
P: Default + BufferRetentionPolicy,
pub fn with_capacity_in(capacity: usize, alloc: A) -> Self
Source§impl<P: BufferRetentionPolicy, const ALIGNMENT: usize, A: Allocator + Clone> AlignedBufferPool<P, ALIGNMENT, A>
impl<P: BufferRetentionPolicy, const ALIGNMENT: usize, A: Allocator + Clone> AlignedBufferPool<P, ALIGNMENT, A>
pub fn new_in(policy: P, capacity: usize, alloc: A) -> Self
Sourcepub fn get(&self) -> UniquePooledAlignedBuffer<P, ALIGNMENT, A>
pub fn get(&self) -> UniquePooledAlignedBuffer<P, ALIGNMENT, A>
Gets a buffer from the pool. If the pool is empty, a new buffer is allocated and returned.
pub fn weak(&self) -> WeakAlignedBufferPool<P, ALIGNMENT, A>
Auto Trait Implementations§
impl<P, const ALIGNMENT: usize, A> Freeze for AlignedBufferPool<P, ALIGNMENT, A>
impl<P, const ALIGNMENT: usize, A> RefUnwindSafe for AlignedBufferPool<P, ALIGNMENT, A>where
P: RefUnwindSafe,
A: RefUnwindSafe,
impl<P, const ALIGNMENT: usize, A> Send for AlignedBufferPool<P, ALIGNMENT, A>
impl<P, const ALIGNMENT: usize, A> Sync for AlignedBufferPool<P, ALIGNMENT, A>
impl<P, const ALIGNMENT: usize, A> Unpin for AlignedBufferPool<P, ALIGNMENT, A>
impl<P, const ALIGNMENT: usize, A> UnwindSafe for AlignedBufferPool<P, ALIGNMENT, A>where
P: RefUnwindSafe,
A: RefUnwindSafe,
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