pub struct OutboundRpcs { /* private fields */ }Expand description
OutboundRpcs handles new outbound rpc requests made from the application layer.
There is one OutboundRpcs handler per Peer.
Implementations
sourceimpl OutboundRpcs
impl OutboundRpcs
pub fn new(
network_context: NetworkContext,
time_service: TimeService,
remote_peer_id: PeerId,
max_concurrent_outbound_rpcs: u32
) -> Self
sourcepub async fn handle_outbound_request(
&mut self,
request: OutboundRpcRequest,
write_reqs_tx: &mut Sender<(NetworkMessage, Sender<Result<(), PeerManagerError>>)>
) -> Result<(), RpcError>
pub async fn handle_outbound_request(
&mut self,
request: OutboundRpcRequest,
write_reqs_tx: &mut Sender<(NetworkMessage, Sender<Result<(), PeerManagerError>>)>
) -> Result<(), RpcError>
Handle a new outbound rpc request from the application layer.
sourcepub fn next_completed_request(
&mut self
) -> impl Future<Output = (RequestId, Result<(f64, u64), RpcError>)> + FusedFuture + '_
pub fn next_completed_request(
&mut self
) -> impl Future<Output = (RequestId, Result<(f64, u64), RpcError>)> + FusedFuture + '_
Method for Peer actor to drive the pending outbound rpc tasks forward.
The returned Future is a FusedFuture so it works correctly in a
futures::select!.
sourcepub fn handle_completed_request(
&mut self,
request_id: RequestId,
result: Result<(f64, u64), RpcError>
)
pub fn handle_completed_request(
&mut self,
request_id: RequestId,
result: Result<(f64, u64), RpcError>
)
Handle a newly completed task from the self.outbound_rpc_tasks queue.
At this point, the application layer’s request has already been fulfilled;
we just need to clean up this request and update some counters.
sourcepub fn handle_inbound_response(&mut self, response: RpcResponse)
pub fn handle_inbound_response(&mut self, response: RpcResponse)
Handle a new inbound RpcResponse message. If we have a pending request
with a matching request id in the pending_outbound_rpcs map, this will
trigger that corresponding task to wake up and complete in
handle_completed_request.
Auto Trait Implementations
impl !RefUnwindSafe for OutboundRpcs
impl Send for OutboundRpcs
impl !Sync for OutboundRpcs
impl Unpin for OutboundRpcs
impl !UnwindSafe for OutboundRpcs
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