Struct ckb_network::peer_registry::PeerRegistry [−][src]
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]
max_inbound: u32,
max_outbound: u32,
whitelist_only: bool,
whitelist_peers: Vec<PeerId>
) -> Self
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
impl RefUnwindSafe for PeerRegistry
impl Send for PeerRegistry
impl Sync for PeerRegistry
impl Unpin for PeerRegistry
impl UnwindSafe for PeerRegistry
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,