pub struct FixedThreadLocalPool<T: PoolItem, const N: usize>(/* private fields */);Expand description
Per-thread pool with capacity N fixed at compile time.
N limits locally retained entries, not active guards. Remote returns may
temporarily exceed N; older overflow is discarded when the queue drains.
UnsafeCell removes dynamic borrow tracking from the hot path. Every
private access is short and never invokes client code or drops an entry.
The storage itself cannot be shared between threads; use its TLS key.
When calling PoolProvider directly, return entries through the same key
used to acquire them. FixedThreadLocalPoolGuard retains that key automatically.
ⓘ
use rylv_pool::{FixedThreadLocalPool, PoolItem};
fn require_sync<T: Sync>() {}
require_sync::<FixedThreadLocalPool<Item, 1>>();Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T, const N: usize> !Freeze for FixedThreadLocalPool<T, N>
impl<T, const N: usize> !RefUnwindSafe for FixedThreadLocalPool<T, N>
impl<T, const N: usize> !Sync for FixedThreadLocalPool<T, N>
impl<T, const N: usize> Send for FixedThreadLocalPool<T, N>where
UnsafeCell<ThreadLocalStorage<T, N>>: Send,
impl<T, const N: usize> Unpin for FixedThreadLocalPool<T, N>where
UnsafeCell<ThreadLocalStorage<T, N>>: Unpin,
impl<T, const N: usize> UnsafeUnpin for FixedThreadLocalPool<T, N>where
UnsafeCell<ThreadLocalStorage<T, N>>: UnsafeUnpin,
impl<T, const N: usize> UnwindSafe for FixedThreadLocalPool<T, N>where
UnsafeCell<ThreadLocalStorage<T, N>>: UnwindSafe,
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