pub struct PoolGuard<'a> { /* private fields */ }Expand description
RAII guard returned by ClassifierPool::acquire.
Holds a single SharedClassifier for the duration of one
translate call. Returns the slot to the pool on drop, including
the panicking-unwind path. Slot return is implemented via
scopeguard::guard so the panic-safety contract is structurally
explicit (see module-level docs).
The 'a lifetime ties this guard to the parent ClassifierPool
borrow so callers cannot stash a guard past the pool’s lifetime.
The actual slot-return mechanism is a cloned Sender inside the
scopeguard closure, not a reference to the pool — but the lifetime
keeps API ergonomics consistent with the previous Drop-based
implementation.
Implementations§
Source§impl<'a> PoolGuard<'a>
impl<'a> PoolGuard<'a>
Sourcepub fn classifier(&self) -> &SharedClassifier
pub fn classifier(&self) -> &SharedClassifier
Borrow the held SharedClassifier.
§Panics
Panics if called after the guard’s Drop impl ran (impossible
through the normal API — the borrow is bound by 'a).
Auto Trait Implementations§
impl<'a> Freeze for PoolGuard<'a>
impl<'a> !RefUnwindSafe for PoolGuard<'a>
impl<'a> Send for PoolGuard<'a>
impl<'a> Sync for PoolGuard<'a>
impl<'a> Unpin for PoolGuard<'a>
impl<'a> UnsafeUnpin for PoolGuard<'a>
impl<'a> !UnwindSafe for PoolGuard<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more