Type Alias libp2p_request_response::RequestResponseEvent

source ยท
pub type RequestResponseEvent<TRequest, TResponse> = Event<TRequest, TResponse>;
๐Ÿ‘ŽDeprecated since 0.24.0: Use re-exports that omit RequestResponse prefix, i.e. libp2p::request_response::Event

Aliased Typeยง

enum RequestResponseEvent<TRequest, TResponse> {
    Message {
        peer: PeerId,
        message: Message<TRequest, TResponse>,
    },
    OutboundFailure {
        peer: PeerId,
        request_id: RequestId,
        error: OutboundFailure,
    },
    InboundFailure {
        peer: PeerId,
        request_id: RequestId,
        error: InboundFailure,
    },
    ResponseSent {
        peer: PeerId,
        request_id: RequestId,
    },
}

Variantsยง

ยง

Message

An incoming message (request or response).

Fields

ยงpeer: PeerId

The peer who sent the message.

ยงmessage: Message<TRequest, TResponse>

The incoming message.

ยง

OutboundFailure

An outbound request failed.

Fields

ยง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.

Fields

ยง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.

Fields

ยงpeer: PeerId

The peer to whom the response was sent.

ยงrequest_id: RequestId

The ID of the inbound request whose response was sent.