pub struct PeerCollection {
pub index_to_peers: HashMap<PeerIndex, Peer>,
pub address_to_peers: HashMap<SaitoPublicKey, PeerIndex>,
pub peer_counter: PeerCounter,
/* private fields */
}
Fields§
§index_to_peers: HashMap<PeerIndex, Peer>
§address_to_peers: HashMap<SaitoPublicKey, PeerIndex>
§peer_counter: PeerCounter
Implementations§
Source§impl PeerCollection
impl PeerCollection
pub fn find_peer_by_address(&self, address: &SaitoPublicKey) -> Option<&Peer>
pub fn find_peer_by_address_mut( &mut self, address: &SaitoPublicKey, ) -> Option<&mut Peer>
pub fn find_peer_by_index(&self, peer_index: u64) -> Option<&Peer>
pub fn find_peer_by_index_mut(&mut self, peer_index: u64) -> Option<&mut Peer>
pub fn remove_reconnected_peer( &mut self, public_key: &SaitoPublicKey, ) -> Option<Peer>
pub fn remove_disconnected_peers(&mut self, current_time: Timestamp)
Trait Implementations§
Source§impl Clone for PeerCollection
impl Clone for PeerCollection
Source§fn clone(&self) -> PeerCollection
fn clone(&self) -> PeerCollection
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PeerCollection
impl Debug for PeerCollection
Source§impl Default for PeerCollection
impl Default for PeerCollection
Source§fn default() -> PeerCollection
fn default() -> PeerCollection
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PeerCollection
impl RefUnwindSafe for PeerCollection
impl Send for PeerCollection
impl Sync for PeerCollection
impl Unpin for PeerCollection
impl UnwindSafe for PeerCollection
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