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
sourceimpl Peer
impl Peer
sourcepub fn is_outbound(&self) -> bool
pub fn is_outbound(&self) -> bool
Check if this is an outbound peer.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Peer
impl Send for Peer
impl Sync for Peer
impl Unpin for Peer
impl UnwindSafe for Peer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more