Enum Event
pub enum Event<TRequest, TResponse, TChannelResponse = TResponse> {
Message {
peer: PeerId,
connection_id: ConnectionId,
message: Message<TRequest, TResponse, TChannelResponse>,
},
OutboundFailure {
peer: PeerId,
connection_id: ConnectionId,
request_id: OutboundRequestId,
error: OutboundFailure,
},
InboundFailure {
peer: PeerId,
connection_id: ConnectionId,
request_id: InboundRequestId,
error: InboundFailure,
},
ResponseSent {
peer: PeerId,
connection_id: ConnectionId,
request_id: InboundRequestId,
},
}
Available on crate feature
request-response
only.Expand description
The events emitted by a request-response Behaviour
.
Variants§
Message
An incoming message (request or response).
Fields
§
connection_id: ConnectionId
The connection used.
OutboundFailure
An outbound request failed.
Fields
§
connection_id: ConnectionId
The connection used.
§
request_id: OutboundRequestId
The (local) ID of the failed request.
§
error: OutboundFailure
The error that occurred.
InboundFailure
An inbound request failed.
Fields
§
connection_id: ConnectionId
The connection used.
§
request_id: InboundRequestId
The ID of the failed inbound request.
§
error: InboundFailure
The error that occurred.
ResponseSent
A response to an inbound request has been sent.
When this event is received, the response has been flushed on the underlying transport connection.
Fields
§
connection_id: ConnectionId
The connection used.
§
request_id: InboundRequestId
The ID of the inbound request whose response was sent.
Trait Implementations§
Auto Trait Implementations§
impl<TRequest, TResponse, TChannelResponse> Freeze for Event<TRequest, TResponse, TChannelResponse>
impl<TRequest, TResponse, TChannelResponse = TResponse> !RefUnwindSafe for Event<TRequest, TResponse, TChannelResponse>
impl<TRequest, TResponse, TChannelResponse> Send for Event<TRequest, TResponse, TChannelResponse>
impl<TRequest, TResponse, TChannelResponse> Sync for Event<TRequest, TResponse, TChannelResponse>
impl<TRequest, TResponse, TChannelResponse> Unpin for Event<TRequest, TResponse, TChannelResponse>
impl<TRequest, TResponse, TChannelResponse = TResponse> !UnwindSafe for Event<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