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
sourceimpl Debug for OutboundRpcRequest
impl Debug for OutboundRpcRequest
sourceimpl Serialize for OutboundRpcRequest
impl Serialize for OutboundRpcRequest
sourceimpl SerializedRequest for OutboundRpcRequest
impl SerializedRequest for OutboundRpcRequest
fn protocol_id(&self) -> ProtocolId
fn data(&self) -> &Bytes
sourcefn to_message<TMessage: DeserializeOwned>(&self) -> Result<TMessage>
fn to_message<TMessage: DeserializeOwned>(&self) -> Result<TMessage>
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
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
sourceimpl<T> Serialize for T where
T: Serialize + ?Sized,
impl<T> Serialize for T where
T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
sourceimpl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
impl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
sourcefn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.
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