Struct bitcoin::p2p::address::AddrV2Message
source · pub struct AddrV2Message {
pub time: u32,
pub services: ServiceFlags,
pub addr: AddrV2,
pub port: u16,
}
Expand description
Address received from BIP155 addrv2 message
Fields§
§time: u32
Time that this node was last seen as connected to the network
services: ServiceFlags
Service bits
addr: AddrV2
Network ID + Network Address
port: u16
Network port, 0 if not applicable
Implementations§
source§impl AddrV2Message
impl AddrV2Message
sourcepub fn socket_addr(&self) -> Result<SocketAddr, Error>
pub fn socket_addr(&self) -> Result<SocketAddr, Error>
Extract socket address from an AddrV2Message message. This will return io::Error io::ErrorKind::AddrNotAvailable if the address type can’t be converted into a SocketAddr.
Trait Implementations§
source§impl Clone for AddrV2Message
impl Clone for AddrV2Message
source§fn clone(&self) -> AddrV2Message
fn clone(&self) -> AddrV2Message
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AddrV2Message
impl Debug for AddrV2Message
source§impl Decodable for AddrV2Message
impl Decodable for AddrV2Message
source§impl Encodable for AddrV2Message
impl Encodable for AddrV2Message
source§impl Hash for AddrV2Message
impl Hash for AddrV2Message
source§impl PartialEq<AddrV2Message> for AddrV2Message
impl PartialEq<AddrV2Message> for AddrV2Message
source§fn eq(&self, other: &AddrV2Message) -> bool
fn eq(&self, other: &AddrV2Message) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ToSocketAddrs for AddrV2Message
impl ToSocketAddrs for AddrV2Message
§type Iter = Once<SocketAddr>
type Iter = Once<SocketAddr>
Returned iterator over socket addresses which this type may correspond
to.
source§fn to_socket_addrs(&self) -> Result<Self::Iter, Error>
fn to_socket_addrs(&self) -> Result<Self::Iter, Error>
Converts this object to an iterator of resolved
SocketAddr
s. Read moreimpl Eq for AddrV2Message
impl StructuralEq for AddrV2Message
impl StructuralPartialEq for AddrV2Message
Auto Trait Implementations§
impl RefUnwindSafe for AddrV2Message
impl Send for AddrV2Message
impl Sync for AddrV2Message
impl Unpin for AddrV2Message
impl UnwindSafe for AddrV2Message
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more