pub struct Handle { /* private fields */ }Expand description
Tier-scoped wrapper around Registry. What crate::Client::with_stats and
crate::Server::with_stats accept. Cheap to clone.
Implementations§
Source§impl Handle
impl Handle
Sourcepub fn refuse(&self, refusal: Refusal)
pub fn refuse(&self, refusal: Refusal)
Count a session refused outside relay admission under its resolved label and tier.
Sourcepub fn session(&self, session: SessionInfo) -> Session
pub fn session(&self, session: SessionInfo) -> Session
Record a connected session on this tier. Hold the returned guard for
the session’s lifetime; dropping it bumps sessions_ended. Counts
presence regardless of any data flow, so a session that merely connects
is still billable. Surfaced on the session track for this tier, keyed by
its label, in its totals, and in that label’s presence track.
Sourcepub fn request(&self, request: SessionInfo) -> Session
pub fn request(&self, request: SessionInfo) -> Session
Count one admitted request under its label and root, and meter its traffic without session presence.
A request has no session end to classify, so it never records a failure.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Handle
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnsafeUnpin for Handle
impl UnwindSafe for Handle
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