Skip to main content

Event

Type Alias Event 

Source
pub type Event = Event<RawRequest, RawResponse>;

Aliased Type§

pub enum Event {
    Message {
        peer: PeerId,
        connection_id: ConnectionId,
        message: Message<RawRequest, RawResponse>,
    },
    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,
    },
}

Variants§

§

Message

An incoming message (request or response).

Fields

§peer: PeerId

The peer who sent the message.

§connection_id: ConnectionId

The connection used.

§message: Message<RawRequest, RawResponse>

The incoming message.

§

OutboundFailure

An outbound request failed.

Fields

§peer: PeerId

The peer to whom the request was sent.

§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

§peer: PeerId

The peer from whom the request was received.

§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

§peer: PeerId

The peer to whom the response was sent.

§connection_id: ConnectionId

The connection used.

§request_id: InboundRequestId

The ID of the inbound request whose response was sent.