Enum Message
pub enum Message<TRequest, TResponse, TChannelResponse = TResponse> {
Request {
request_id: InboundRequestId,
request: TRequest,
channel: ResponseChannel<TChannelResponse>,
},
Response {
request_id: OutboundRequestId,
response: TResponse,
},
}
Available on crate feature
request-response
only.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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