Enum libp2p::request_response::Message
source · pub enum Message<TRequest, TResponse, TChannelResponse = TResponse> {
Request {
request_id: RequestId,
request: TRequest,
channel: ResponseChannel<TChannelResponse>,
},
Response {
request_id: RequestId,
response: TResponse,
},
}
Expand description
An inbound request or response.
Variants§
Request
A request message.
Fields
§
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.
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