Struct network::protocols::rpc::OutboundRpcRequest [−][src]
pub struct OutboundRpcRequest {
pub protocol_id: ProtocolId,
pub data: Bytes,
pub res_tx: Sender<Result<Bytes, RpcError>>,
pub timeout: Duration,
}Expand description
A wrapper struct for an outbound rpc request and its associated context.
Fields
protocol_id: ProtocolIdThe remote peer’s application module that should handle our outbound rpc request.
For example, if protocol_id == ProtocolId::ConsensusRpcBcs, then this
outbound rpc request should be handled by the remote peer’s consensus
application module.
data: BytesThe serialized request data to be sent to the receiver. At this layer in the stack, the request data is just an opaque blob.
res_tx: Sender<Result<Bytes, RpcError>>Channel over which the rpc response is sent from the rpc layer to the upper client layer.
If there is an error while performing the rpc protocol, e.g., the remote
peer drops the connection, we will send an RpcError over the channel.
timeout: DurationThe timeout duration for the entire rpc call. If the timeout elapses, the
rpc layer will send an RpcError::TimedOut error over the
res_tx channel to the upper client layer.
Trait Implementations
Converts the SerializedMessage into its deserialized version of TMessage based on the
ProtocolId. See: ProtocolId::from_bytes Read more
Auto Trait Implementations
impl !RefUnwindSafe for OutboundRpcRequest
impl Send for OutboundRpcRequest
impl Sync for OutboundRpcRequest
impl Unpin for OutboundRpcRequest
impl !UnwindSafe for OutboundRpcRequest
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
Generates a hash used only for tests.