pub struct PeerRegistry { /* private fields */ }Available on crate feature
server only.Expand description
A registry of the peers this server has registered, keyed by peer id.
Only the parts the server needs at request time; the full registration state belongs in the integrator’s own storage.
Implementations§
Source§impl PeerRegistry
impl PeerRegistry
Sourcepub fn upsert(&self, peer: AuthenticatedPeer)
pub fn upsert(&self, peer: AuthenticatedPeer)
Records or replaces a peer.
Sourcepub fn get(&self, peer_id: &str) -> Option<AuthenticatedPeer>
pub fn get(&self, peer_id: &str) -> Option<AuthenticatedPeer>
Looks a peer up by id.
Sourcepub fn remove(&self, peer_id: &str) -> Option<AuthenticatedPeer>
pub fn remove(&self, peer_id: &str) -> Option<AuthenticatedPeer>
Forgets a peer, as a credentials DELETE does.
Sourcepub fn all(&self) -> Vec<AuthenticatedPeer>
pub fn all(&self) -> Vec<AuthenticatedPeer>
Every registered peer.
Trait Implementations§
Source§impl Debug for PeerRegistry
impl Debug for PeerRegistry
Source§impl Default for PeerRegistry
impl Default for PeerRegistry
Source§fn default() -> PeerRegistry
fn default() -> PeerRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for PeerRegistry
impl RefUnwindSafe for PeerRegistry
impl Send for PeerRegistry
impl Sync for PeerRegistry
impl Unpin for PeerRegistry
impl UnsafeUnpin for PeerRegistry
impl UnwindSafe for PeerRegistry
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