Enum libp2p::request_response::RequestResponseEvent[][src]

pub enum RequestResponseEvent<TRequest, TResponse, TChannelResponse = TResponse> {
    Message {
        peer: PeerId,
        message: RequestResponseMessage<TRequest, TResponse, TChannelResponse>,
    },
    OutboundFailure {
        peer: PeerId,
        request_id: RequestId,
        error: OutboundFailure,
    },
    InboundFailure {
        peer: PeerId,
        request_id: RequestId,
        error: InboundFailure,
    },
    ResponseSent {
        peer: PeerId,
        request_id: RequestId,
    },
}
Expand description

The events emitted by a RequestResponse protocol.

Variants

Message

An incoming message (request or response).

Show fields

Fields of Message

peer: PeerId

The peer who sent the message.

message: RequestResponseMessage<TRequest, TResponse, TChannelResponse>

The incoming message.

OutboundFailure

An outbound request failed.

Show fields

Fields of OutboundFailure

peer: PeerId

The peer to whom the request was sent.

request_id: RequestId

The (local) ID of the failed request.

error: OutboundFailure

The error that occurred.

InboundFailure

An inbound request failed.

Show fields

Fields of InboundFailure

peer: PeerId

The peer from whom the request was received.

request_id: RequestId

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.

Show fields

Fields of ResponseSent

peer: PeerId

The peer to whom the response was sent.

request_id: RequestId

The ID of the inbound request whose response was sent.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.