Struct sozu_lib::server::SessionManager
source · pub struct SessionManager {
pub max_connections: usize,
pub nb_connections: usize,
pub can_accept: bool,
pub slab: Slab<Rc<RefCell<dyn ProxySession>>>,
}
Fields§
§max_connections: usize
§nb_connections: usize
§can_accept: bool
§slab: Slab<Rc<RefCell<dyn ProxySession>>>
Implementations§
source§impl SessionManager
impl SessionManager
pub fn new( slab: Slab<Rc<RefCell<dyn ProxySession>>>, max_connections: usize ) -> Rc<RefCell<Self>>
sourcepub fn at_capacity(&self) -> bool
pub fn at_capacity(&self) -> bool
The slab is considered at capacity if it contains more sessions than twice max_connections
sourcepub fn check_limits(&mut self) -> bool
pub fn check_limits(&mut self) -> bool
Check the number of connections against max_connections, and the slab capacity. Returns false if limits are reached.
pub fn to_session(token: Token) -> SessionToken
pub fn incr(&mut self)
Auto Trait Implementations§
impl !RefUnwindSafe for SessionManager
impl !Send for SessionManager
impl !Sync for SessionManager
impl Unpin for SessionManager
impl !UnwindSafe for SessionManager
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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