pub struct Peers {
mutex: Arc<Mutex<PeerMap>>,
}
Expand description
The collection of currently connected peer nodes.
This object uses internal locking and is shared between all network connection tasks.
Fields§
§mutex: Arc<Mutex<PeerMap>>
Implementations§
source§impl Peers
impl Peers
pub fn new(capacity: usize, stats_counter: Metrics) -> Self
fn inner(&self) -> OwnedMutexLockFuture<PeerMap>
pub async fn clear(&self)
pub async fn add_connecting( &self, peer: NodeId, remote_addr: Address, handle: ConnectHandle, options: ConnectOptions )
pub async fn update_entry(&self, peer: NodeId)
pub async fn remove_peer(&self, peer: &NodeId) -> Option<PeerComms>
pub async fn generate_auth_nonce(&self, peer_addr: Address) -> [u8; 32]
pub async fn server_complete_handshake<F>( &self, peer_addr: Address, id: NodeId, verify: F ) -> Result<(), Error>where F: FnOnce([u8; 32]) -> Result<(), Error>,
pub async fn client_id(&self, peer_addr: Address) -> Option<NodeId>
sourcepub async fn subscribe_to_block_events(
&self,
peer: &NodeId
) -> Option<BlockEventSubscription>
pub async fn subscribe_to_block_events( &self, peer: &NodeId ) -> Option<BlockEventSubscription>
returns None
if the handshake process was not completed successfully
sourcepub async fn subscribe_to_fragments(
&self,
peer: &NodeId
) -> Option<FragmentSubscription>
pub async fn subscribe_to_fragments( &self, peer: &NodeId ) -> Option<FragmentSubscription>
returns None
if the handshake process was not completed successfully
sourcepub async fn subscribe_to_gossip(
&self,
peer: &NodeId
) -> Option<GossipSubscription>
pub async fn subscribe_to_gossip( &self, peer: &NodeId ) -> Option<GossipSubscription>
returns None
if the handshake process was not completed successfully
async fn propagate_with<T, F>(&self, peer: NodeId, f: F) -> Result<(), NodeId>where for<'a> F: Fn(CommStatus<'a>) -> Result<(), PropagateError<T>>,
pub async fn propagate_block( &self, peer: NodeId, header: Header ) -> Result<(), NodeId>
pub async fn propagate_fragment( &self, peer: NodeId, fragment: Fragment ) -> Result<(), NodeId>
pub async fn propagate_gossip_to( &self, peer: NodeId, gossip: Gossip ) -> Result<(), Gossip>
pub async fn refresh_peer_on_block(&self, peer: &NodeId) -> bool
pub async fn refresh_peer_on_fragment(&self, peer: &NodeId) -> bool
pub fn get_peer_addr(&self, node_id: NodeId) -> GetNodeAddress ⓘ
pub async fn refresh_peer_on_gossip(&self, peer: &NodeId) -> bool
pub async fn solicit_blocks_any(&self, hashes: BlockIds)
pub async fn solicit_blocks_peer(&self, peer: &NodeId, hashes: BlockIds)
pub async fn pull_headers(&self, peer: &NodeId, from: BlockIds, to: BlockId)
pub async fn infos(&self) -> Vec<PeerInfo>
Auto Trait Implementations§
impl !RefUnwindSafe for Peers
impl Send for Peers
impl Sync for Peers
impl Unpin for Peers
impl !UnwindSafe for Peers
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request