pub struct HealthCheckerNetworkSender { /* private fields */ }Expand description
The interface from HealthChecker to Networking layer.
This is a thin wrapper around a NetworkSender<HealthCheckerMsg>, so it is
easy to clone and send off to a separate task. For example, the rpc requests
return Futures that encapsulate the whole flow, from sending the request to
remote, to finally receiving the response and deserializing. It therefore
makes the most sense to make the rpc call on a separate async task, which
requires the HealthCheckerNetworkSender to be Clone and Send.
Implementations
sourceimpl HealthCheckerNetworkSender
impl HealthCheckerNetworkSender
pub async fn disconnect_peer(
&mut self,
peer_id: PeerId
) -> Result<(), NetworkError>
Trait Implementations
sourceimpl ApplicationNetworkSender<HealthCheckerMsg> for HealthCheckerNetworkSender
impl ApplicationNetworkSender<HealthCheckerMsg> for HealthCheckerNetworkSender
sourcefn send_rpc<'life0, 'async_trait>(
&'life0 self,
recipient: PeerId,
req_msg: HealthCheckerMsg,
timeout: Duration
) -> Pin<Box<dyn Future<Output = Result<HealthCheckerMsg, RpcError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn send_rpc<'life0, 'async_trait>(
&'life0 self,
recipient: PeerId,
req_msg: HealthCheckerMsg,
timeout: Duration
) -> Pin<Box<dyn Future<Output = Result<HealthCheckerMsg, RpcError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Send a HealthChecker Ping RPC request to remote peer recipient. Returns
the remote peer’s future Pong reply.
The rpc request can be canceled at any point by dropping the returned future.
fn send_to(
&self,
_recipient: PeerId,
_message: TMessage
) -> Result<(), NetworkError>
fn send_to_many(
&self,
_recipients: impl Iterator<Item = PeerId>,
_message: TMessage
) -> Result<(), NetworkError>
sourceimpl Clone for HealthCheckerNetworkSender
impl Clone for HealthCheckerNetworkSender
sourcefn clone(&self) -> HealthCheckerNetworkSender
fn clone(&self) -> HealthCheckerNetworkSender
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl NewNetworkSender for HealthCheckerNetworkSender
impl NewNetworkSender for HealthCheckerNetworkSender
fn new(
peer_mgr_reqs_tx: PeerManagerRequestSender,
connection_reqs_tx: ConnectionRequestSender
) -> Self
Auto Trait Implementations
impl RefUnwindSafe for HealthCheckerNetworkSender
impl Send for HealthCheckerNetworkSender
impl Sync for HealthCheckerNetworkSender
impl Unpin for HealthCheckerNetworkSender
impl UnwindSafe for HealthCheckerNetworkSender
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more