Struct aligned_buffer_pool::AlignedBufferPool
source · pub struct AlignedBufferPool<P: BufferRetentionPolicy, const ALIGNMENT: usize, A: Allocator + Clone = Global> { /* private fields */ }Expand description
A pool for allocating and recycling aligned buffers.
Implementations§
source§impl<P: BufferRetentionPolicy, const ALIGNMENT: usize> AlignedBufferPool<P, ALIGNMENT, Global>
impl<P: BufferRetentionPolicy, const ALIGNMENT: usize> AlignedBufferPool<P, ALIGNMENT, Global>
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,
pub fn with_capacity(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
A: RefUnwindSafe,
P: 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
A: RefUnwindSafe,
P: RefUnwindSafe,
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.