Struct ckb_network::peer_registry::PeerRegistry[][src]

pub struct PeerRegistry { /* fields omitted */ }

Memory records of opened session information

Implementations

impl PeerRegistry[src]

pub fn new(
    max_inbound: u32,
    max_outbound: u32,
    whitelist_only: bool,
    whitelist_peers: Vec<PeerId>
) -> Self
[src]

Init registry from config

pub fn add_feeler(&mut self, peer_id: PeerId)[src]

Add feeler dail task

pub fn remove_feeler(&mut self, peer_id: &PeerId)[src]

Remove feeler dail task on session disconnects or fails

pub fn is_feeler(&self, peer_id: &PeerId) -> bool[src]

Whether this session is feeler session

pub fn get_peer(&self, session_id: SessionId) -> Option<&Peer>[src]

Get peer info

pub fn get_peer_mut(&mut self, session_id: SessionId) -> Option<&mut Peer>[src]

Get mut peer info

pub fn get_key_by_peer_id(&self, peer_id: &PeerId) -> Option<SessionId>[src]

Get session id by peer id

pub fn peers(&self) -> &HashMap<SessionId, Peer>[src]

Get all connected peers’ information

pub fn connected_peers(&self) -> Vec<SessionId>[src]

Get all sessions’ id

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsAny for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,