Struct network::protocols::rpc::InboundRpcs [−][src]
pub struct InboundRpcs { /* fields omitted */ }Expand description
InboundRpcs handles new inbound rpc requests off the wire, notifies the
PeerManager of the new request, and stores the pending response on a queue.
If the response eventually completes, InboundRpc records some metrics and
enqueues the response message onto the outbound write queue.
There is one InboundRpcs handler per Peer.
Implementations
pub fn new(
network_context: NetworkContext,
time_service: TimeService,
remote_peer_id: PeerId,
inbound_rpc_timeout: Duration,
max_concurrent_inbound_rpcs: u32
) -> Self
pub fn handle_inbound_request(
&mut self,
peer_notifs_tx: &mut Sender<ProtocolId, PeerNotification>,
request: RpcRequest
) -> Result<(), RpcError>
pub fn handle_inbound_request(
&mut self,
peer_notifs_tx: &mut Sender<ProtocolId, PeerNotification>,
request: RpcRequest
) -> Result<(), RpcError>
Handle a new inbound RpcRequest message off the wire.
pub fn next_completed_response(
&mut self
) -> impl Future<Output = Result<RpcResponse, RpcError>> + FusedFuture + '_
pub fn next_completed_response(
&mut self
) -> impl Future<Output = Result<RpcResponse, RpcError>> + FusedFuture + '_
Method for Peer actor to drive the pending inbound rpc tasks forward.
The returned Future is a FusedFuture so it works correctly in a
futures::select!.
pub async fn send_outbound_response(
&mut self,
write_reqs_tx: &mut Sender<(NetworkMessage, Sender<Result<(), PeerManagerError>>)>,
maybe_response: Result<RpcResponse, RpcError>
) -> Result<(), RpcError>
pub async fn send_outbound_response(
&mut self,
write_reqs_tx: &mut Sender<(NetworkMessage, Sender<Result<(), PeerManagerError>>)>,
maybe_response: Result<RpcResponse, RpcError>
) -> Result<(), RpcError>
Handle a completed response from the application handler. If successful, we update the appropriate counters and enqueue the response message onto the outbound write queue.
Auto Trait Implementations
impl !RefUnwindSafe for InboundRpcs
impl Send for InboundRpcs
impl !Sync for InboundRpcs
impl Unpin for InboundRpcs
impl !UnwindSafe for InboundRpcs
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self