Struct nakamoto_p2p::fsm::Peer

source ·
pub struct Peer {
    pub addr: SocketAddr,
    pub local_addr: SocketAddr,
    pub link: Link,
    pub since: LocalTime,
    pub height: Height,
    pub services: ServiceFlags,
    pub user_agent: String,
    pub relay: bool,
}
Expand description

A remote peer.

Fields

addr: SocketAddr

Peer address.

local_addr: SocketAddr

Local peer address.

link: Link

Whether this is an inbound or outbound peer connection.

since: LocalTime

Connected since this time.

height: Height

The peer’s best height.

services: ServiceFlags

The peer’s services.

user_agent: String

Peer user agent string.

relay: bool

Whether this peer relays transactions.

Implementations

Check if this is an outbound peer.

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
Converts to this type from the input type.

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