pub struct InboundRpcs { /* private fields */ }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
sourceimpl InboundRpcs
impl InboundRpcs
pub fn new(
network_context: NetworkContext,
time_service: TimeService,
remote_peer_id: PeerId,
inbound_rpc_timeout: Duration,
max_concurrent_inbound_rpcs: u32
) -> Self
sourcepub 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.
sourcepub 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!.
sourcepub 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
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