pub struct PoolRegistry { /* private fields */ }Expand description
The account-agnostic registry of session pools, keyed by (account, user).
Cheap to clone (everything is behind Arc). The map mutex is std (never held
across .await); the shared auth gate serializes browser auths across pools.
Implementations§
Source§impl PoolRegistry
impl PoolRegistry
Sourcepub fn get_or_create(&self, key: &SessionKey, max: usize) -> Arc<SessionPool>
pub fn get_or_create(&self, key: &SessionKey, max: usize) -> Arc<SessionPool>
Returns the pool for key, creating an empty one (no auth) if absent.
New pools share the registry’s auth gate, so all browser auths across all
pools are serialized to one at a time.
Sourcepub fn remove(&self, key: &SessionKey) -> Option<Arc<SessionPool>>
pub fn remove(&self, key: &SessionKey) -> Option<Arc<SessionPool>>
Removes the pool for key. Returns it if present.
Sourcepub fn remove_by_id(&self, id: u64) -> Option<Arc<SessionPool>>
pub fn remove_by_id(&self, id: u64) -> Option<Arc<SessionPool>>
Removes the pool with the given id. Returns it if present.
Sourcepub fn take_all(&self) -> Vec<Arc<SessionPool>>
pub fn take_all(&self) -> Vec<Arc<SessionPool>>
Drains and returns every pool.
Sourcepub fn snapshot(&self) -> Vec<SessionInfo>
pub fn snapshot(&self) -> Vec<SessionInfo>
A snapshot of every pool, ordered by id. Sync; no awaits.
Trait Implementations§
Source§impl Clone for PoolRegistry
impl Clone for PoolRegistry
Source§fn clone(&self) -> PoolRegistry
fn clone(&self) -> PoolRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PoolRegistry
impl !UnwindSafe for PoolRegistry
impl Freeze for PoolRegistry
impl Send for PoolRegistry
impl Sync for PoolRegistry
impl Unpin for PoolRegistry
impl UnsafeUnpin for PoolRegistry
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