Struct ServerLimits
pub struct ServerLimits { /* private fields */ }Expand description
The server’s limit table.
Implementations§
§impl ServerLimits
impl ServerLimits
pub fn define(&self, name: &str, spec: LimitSpec)
pub fn acquire(
&self,
name: &str,
conn: u64,
ticket: u64,
priority: &Priority,
now: u64,
lease_ms: u64,
) -> Grant
pub fn acquire( &self, name: &str, conn: u64, ticket: u64, priority: &Priority, now: u64, lease_ms: u64, ) -> Grant
Queues ticket of session conn at priority (the first time it is
asked for), then grants the permit to the ticket the queue serves
next if it is one of conn’s and the limit has room.
pub fn release(&self, name: &str, conn: u64, ticket: u64)
pub fn disconnected(&self, conn: u64)
pub fn disconnected(&self, conn: u64)
A connection went away: its queued tickets leave the queue. Its permits stay until their leases expire (its steps may still run).
pub fn in_use(&self, name: &str, now: u64) -> u32
pub fn max_in_use(&self, name: &str) -> u32
Trait Implementations§
§impl Debug for ServerLimits
impl Debug for ServerLimits
Auto Trait Implementations§
impl !Freeze for ServerLimits
impl Forget for ServerLimits
impl Move for ServerLimits
impl RefUnwindSafe for ServerLimits
impl Send for ServerLimits
impl Sync for ServerLimits
impl Unpin for ServerLimits
impl UnsafeUnpin for ServerLimits
impl UnwindSafe for ServerLimits
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