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: ProtocolId

The 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: Bytes

The 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: Duration

The 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

Formats the value using the given formatter. Read more

Serialize this value into the given Serde serializer. Read more

Converts the SerializedMessage into its deserialized version of TMessage based on the ProtocolId. See: ProtocolId::from_bytes Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

Generates a hash used only for tests.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more