pub struct PoolSlot { /* private fields */ }Expand description
A handle to a locked memory region containing secret data.
The slot is either backed by a tier slab (mlock’d single-page pool) or a
standalone SecureBuffer (guard pages + mlock, for larger allocations).
PoolSlot is Send but NOT Sync; exclusive reference semantics prevent
concurrent mutation.
§Safety of the slab pointer
When origin is Slab, ptr points into a TieredPool tier’s SecureSlab
which lives in a OnceLock<TieredPool> and is never dropped for the
process lifetime. The pointer therefore cannot dangle as long as the
process is alive.
§Safety
PoolSlot must not outlive the global pool. Only acquire via the module-level
pool_acquire() and coffer_view() functions, not via a local TieredPool instance.
The TieredPool::acquire() method is intentionally pub(crate) for this reason.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Sync for PoolSlot
impl Freeze for PoolSlot
impl RefUnwindSafe for PoolSlot
impl Unpin for PoolSlot
impl UnsafeUnpin for PoolSlot
impl UnwindSafe for PoolSlot
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