pub enum Event {
InboundRequest {
peer: PeerId,
protocol: Cow<'static, str>,
result: Result<(), ResponseFailure>,
},
RequestFinished {
peer: PeerId,
protocol: Cow<'static, str>,
duration: Duration,
result: Result<(), String>,
},
}
Expand description
Event generated by the RequestResponseFactoryBehaviour
.
Variants§
InboundRequest
A remote sent a request and either we have successfully answered it or an error happened.
This event is generated for statistics purposes.
Fields
§
peer: PeerId
Peer which has emitted the request.
§
result: Result<(), ResponseFailure>
Whether handling the request was successful or unsuccessful.
When successful contains the time elapsed between when we received the request and when we sent back the response. When unsuccessful contains the failure reason.
RequestFinished
A request initiated using RequestResponseFactoryBehaviour::send_request
has succeeded or
failed.
This event is generated for statistics purposes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl !RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl !UnwindSafe for Event
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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