pub struct PeerComms {
remote_addr: Address,
block_announcements: CommHandle<Header>,
block_solicitations: CommHandle<BlockIds>,
chain_pulls: CommHandle<ChainPullRequest>,
fragments: CommHandle<Fragment>,
gossip: CommHandle<Gossip>,
}
Expand description
State of the communication streams that a single peer connection polls for outbound data and commands.
Dropping a PeerComms
instance results in the client-side connection to
be closed if it was established, or all outbound subscription streams of a
server-side connection to be closed.
Fields§
§remote_addr: Address
§block_announcements: CommHandle<Header>
§block_solicitations: CommHandle<BlockIds>
§chain_pulls: CommHandle<ChainPullRequest>
§fragments: CommHandle<Fragment>
§gossip: CommHandle<Gossip>
Implementations§
source§impl PeerComms
impl PeerComms
pub fn new(remote_addr: Address) -> PeerComms
pub fn remote_addr(&self) -> Address
pub fn has_client_subscriptions(&self) -> bool
pub fn update(&mut self, newer: PeerComms)
pub fn clear_pending(&mut self)
pub fn set_pending_block_announcement(&mut self, header: Header)
pub fn set_pending_fragment(&mut self, fragment: Fragment)
pub fn set_pending_gossip(&mut self, gossip: Gossip)
pub fn try_send_block_announcement( &mut self, header: Header ) -> Result<(), PropagateError<Header>>
pub fn try_send_fragment( &mut self, fragment: Fragment ) -> Result<(), PropagateError<Fragment>>
pub fn try_send_gossip( &mut self, gossip: Gossip ) -> Result<(), PropagateError<Gossip>>
pub fn subscribe_to_block_announcements( &mut self ) -> OutboundSubscription<Header>
pub fn subscribe_to_block_solicitations( &mut self ) -> OutboundSubscription<BlockIds>
pub fn subscribe_to_chain_pulls( &mut self ) -> OutboundSubscription<ChainPullRequest>
pub fn subscribe_to_block_events(&mut self) -> BlockEventSubscription
pub fn subscribe_to_fragments(&mut self) -> FragmentSubscription
pub fn subscribe_to_gossip(&mut self) -> GossipSubscription
pub fn block_announcements_subscribed(&self) -> bool
pub fn fragments_subscribed(&self) -> bool
pub fn gossip_subscribed(&self) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for PeerComms
impl Send for PeerComms
impl Sync for PeerComms
impl Unpin for PeerComms
impl !UnwindSafe for PeerComms
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