Enum libp2p_request_response::Message
source · pub enum Message<TRequest, TResponse, TChannelResponse = TResponse> {
Request {
request_id: InboundRequestId,
request: TRequest,
channel: ResponseChannel<TChannelResponse>,
},
Response {
request_id: OutboundRequestId,
response: TResponse,
},
}
Expand description
An inbound request or response.
Variants§
Request
A request message.
Fields
§
request_id: InboundRequestId
The ID of this request.
§
request: TRequest
The request message.
§
channel: ResponseChannel<TChannelResponse>
The channel waiting for the response.
If this channel is dropped instead of being used to send a response
via Behaviour::send_response
, a Event::InboundFailure
with InboundFailure::ResponseOmission
is emitted.
Response
A response message.
Fields
§
request_id: OutboundRequestId
The ID of the request that produced this response.
§
response: TResponse
The response message.
Trait Implementations§
Auto Trait Implementations§
impl<TRequest, TResponse, TChannelResponse> Freeze for Message<TRequest, TResponse, TChannelResponse>
impl<TRequest, TResponse, TChannelResponse = TResponse> !RefUnwindSafe for Message<TRequest, TResponse, TChannelResponse>
impl<TRequest, TResponse, TChannelResponse> Send for Message<TRequest, TResponse, TChannelResponse>
impl<TRequest, TResponse, TChannelResponse> Sync for Message<TRequest, TResponse, TChannelResponse>
impl<TRequest, TResponse, TChannelResponse> Unpin for Message<TRequest, TResponse, TChannelResponse>
impl<TRequest, TResponse, TChannelResponse = TResponse> !UnwindSafe for Message<TRequest, TResponse, TChannelResponse>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more