pub struct Registry { /* private fields */ }Expand description
The connection set of one application.
Implementations§
Source§impl Registry
impl Registry
pub fn new(config: Config) -> Arc<Registry>
Sourcepub fn watch(&self) -> Receiver<Value>
pub fn watch(&self) -> Receiver<Value>
Wake on every change to it. A subscription watches this only when the program’s page
reads presence — a program that never asks who is connected must not re-render when
somebody connects.
Sourcepub fn refused(&self) -> u64
pub fn refused(&self) -> u64
How many joins the capacity refused, for the life of this process.
Sourcepub fn join(self: &Arc<Self>, actor: &str) -> Guard
pub fn join(self: &Arc<Self>, actor: &str) -> Guard
Record a connection. The roster holds it until the returned guard is dropped.
A guard rather than a pair of calls, for the reason every other guard in this crate is one: a subscription ends by returning, by erroring or by its socket dying, and a roster that only removed an actor on the happy path would fill up with people who left hours ago.
Auto Trait Implementations§
impl !Freeze for Registry
impl !RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl !UnwindSafe for Registry
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