Struct bdk_chain::bitcoin::p2p::address::AddrV2Message
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§
§impl AddrV2Message
impl AddrV2Message
pub 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§
§impl Clone for AddrV2Message
impl Clone for AddrV2Message
§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 more§impl Debug for AddrV2Message
impl Debug for AddrV2Message
§impl Decodable for AddrV2Message
impl Decodable for AddrV2Message
§impl Encodable for AddrV2Message
impl Encodable for AddrV2Message
§impl Hash for AddrV2Message
impl Hash for AddrV2Message
§impl PartialEq for AddrV2Message
impl PartialEq for AddrV2Message
§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 ==
.§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.
§fn to_socket_addrs(
&self
) -> Result<<AddrV2Message as ToSocketAddrs>::Iter, Error>
fn to_socket_addrs( &self ) -> Result<<AddrV2Message as ToSocketAddrs>::Iter, Error>
Converts this object to an iterator of resolved
SocketAddr
s. Read moreimpl Eq for AddrV2Message
impl StructuralPartialEq for AddrV2Message
Auto Trait Implementations§
impl Freeze for AddrV2Message
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more