pub struct PrompterGuard(/* private fields */);Expand description
One live prompter’s claim on one session, released when dropped (#8100).
Why: every prompter path ends in a different way — session.detach fires
a cancel channel, an HTTP SSE body is dropped when the socket closes, a
session.events stream ends when its receiver goes. A guard whose Drop
does the decrementing needs none of them to agree on a teardown call, and
covers the case the timeout was hiding: a client that dies mid-ask.
What: holds the session’s counter directly rather than a handle to the
registry, so releasing it never re-enters the registry lock and a session
removed from the map while a client is still attached cannot strand a
count on an entry that no longer exists.
Test: registry_tests::prompter_claim_is_released_when_its_guard_drops.
Trait Implementations§
Source§impl Drop for PrompterGuard
impl Drop for PrompterGuard
Auto Trait Implementations§
impl Freeze for PrompterGuard
impl RefUnwindSafe for PrompterGuard
impl Send for PrompterGuard
impl Sync for PrompterGuard
impl Unpin for PrompterGuard
impl UnsafeUnpin for PrompterGuard
impl UnwindSafe for PrompterGuard
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