pub struct SingleplexPool<R: Send> { /* private fields */ }Expand description
Exclusive resource ownership. Resources need Send, without requiring Sync.
Clean reuse is an explicit lease release; unfinished lease drop retires it.
Implementations§
Source§impl<R: Send> SingleplexPool<R>
impl<R: Send> SingleplexPool<R>
pub fn new(options: Options) -> Result<Self, Error>
pub async fn acquire_or_reserve( &self, cancel: &Cancellation, ) -> Result<Acquisition<SingleplexLease<R>, SingleplexBuildPermit<R>>, Error>
pub fn begin_close(&self)
pub fn stats(&self) -> Stats
Sourcepub fn prune(&self, retain: usize) -> usize
pub fn prune(&self, retain: usize) -> usize
Retire unused registrations until at most retain live resources remain,
or until only in-use resources remain. No I/O occurs here.
pub fn try_retirement(&self) -> Option<Retirement<R>>
Sourcepub async fn next_retirement(
&self,
cancel: &Cancellation,
) -> Result<Option<Retirement<R>>, Error>
pub async fn next_retirement( &self, cancel: &Cancellation, ) -> Result<Option<Retirement<R>>, Error>
Wait for cleanup work; None means admission is closed and all resources
and construction/retirement obligations have finished.
Sourcepub async fn wait_closed(&self, cancel: &Cancellation) -> Result<(), Error>
pub async fn wait_closed(&self, cancel: &Cancellation) -> Result<(), Error>
Call begin_close, finish active work and drain retirements concurrently.
This waits for acknowledgments; it does not execute resource cleanup.
Trait Implementations§
Source§impl<R: Send> Clone for SingleplexPool<R>
impl<R: Send> Clone for SingleplexPool<R>
Source§impl<R: Send> Pool for SingleplexPool<R>
impl<R: Send> Pool for SingleplexPool<R>
type Permit = SingleplexLease<R>
type BuildPermit = SingleplexBuildPermit<R>
async fn acquire_or_reserve( &self, cancel: &Cancellation, ) -> Result<Acquisition<Self::Permit, Self::BuildPermit>, Error>
fn begin_close(&self)
fn stats(&self) -> Stats
Auto Trait Implementations§
impl<R> Freeze for SingleplexPool<R>
impl<R> RefUnwindSafe for SingleplexPool<R>where
Arc<Core<SingleSlot<R>>>: RefUnwindSafe,
impl<R> Send for SingleplexPool<R>
impl<R> Sync for SingleplexPool<R>
impl<R> Unpin for SingleplexPool<R>
impl<R> UnsafeUnpin for SingleplexPool<R>where
Arc<Core<SingleSlot<R>>>: UnsafeUnpin,
impl<R> UnwindSafe for SingleplexPool<R>where
Arc<Core<SingleSlot<R>>>: 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