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 Freeze for SessionManager
impl !RefUnwindSafe for SessionManager
impl !Send for SessionManager
impl !Sync for SessionManager
impl Unpin for SessionManager
impl !UnwindSafe for SessionManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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