pub enum PeerEvent {
    VersionReceived {
        addr: SocketAddr,
        msg: VersionMessage,
    },
    Negotiated {
        addr: SocketAddr,
        link: Link,
        services: ServiceFlags,
        user_agent: String,
        height: u64,
        version: u32,
    },
    Connecting(SocketAddrSource, ServiceFlags),
    ConnectionFailed(SocketAddrArc<Error>),
    Connected(SocketAddrLink),
    Disconnected(SocketAddr, DisconnectReason<DisconnectReason>),
}
Expand description

An event originating in the peer manager.

Variants

VersionReceived

Fields

addr: SocketAddr

The peer’s id.

msg: VersionMessage

The version message.

The version message was received from a peer.

Negotiated

Fields

addr: SocketAddr

The peer’s id.

link: Link

Connection link.

services: ServiceFlags

Services offered by negotiated peer.

user_agent: String

Peer user agent.

height: u64

Peer height.

version: u32

Protocol version.

A peer has successfully negotiated (handshaked).

Connecting(SocketAddrSource, ServiceFlags)

Connecting to a peer found from the specified source.

ConnectionFailed(SocketAddrArc<Error>)

Connection attempt failed.

Connected(SocketAddrLink)

A new peer has connected and is ready to accept messages. This event is triggered before the peer handshake has successfully completed.

Disconnected(SocketAddr, DisconnectReason<DisconnectReason>)

A peer has been disconnected.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
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.