pub struct NetAddr<H: Host> {
pub host: H,
pub port: u16,
}Fields§
§host: H§port: u16Implementations§
Trait Implementations§
Source§impl<'de, H> Deserialize<'de> for NetAddr<H>where
H: Deserialize<'de> + Host,
impl<'de, H> Deserialize<'de> for NetAddr<H>where
H: Deserialize<'de> + Host,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<H: Host, const DEFAULT_PORT: u16> From<PartialAddr<H, DEFAULT_PORT>> for NetAddr<H>
impl<H: Host, const DEFAULT_PORT: u16> From<PartialAddr<H, DEFAULT_PORT>> for NetAddr<H>
Source§fn from(addr: PartialAddr<H, DEFAULT_PORT>) -> Self
fn from(addr: PartialAddr<H, DEFAULT_PORT>) -> Self
Converts to this type from the input type.
Source§impl<Id: EcPk, A: Addr, To: Host> From<PeerAddr<Id, A>> for NetAddr<To>
Available on crate features p2p-ed25519 or p2p-secp256k1 only.
impl<Id: EcPk, A: Addr, To: Host> From<PeerAddr<Id, A>> for NetAddr<To>
Available on crate features
p2p-ed25519 or p2p-secp256k1 only.Source§impl<H> From<SocketAddr> for NetAddr<H>
impl<H> From<SocketAddr> for NetAddr<H>
Source§fn from(socket_addr: SocketAddr) -> Self
fn from(socket_addr: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl<H> From<SocketAddrV4> for NetAddr<H>
impl<H> From<SocketAddrV4> for NetAddr<H>
Source§fn from(socket_addr: SocketAddrV4) -> Self
fn from(socket_addr: SocketAddrV4) -> Self
Converts to this type from the input type.
Source§impl<H> From<SocketAddrV6> for NetAddr<H>
impl<H> From<SocketAddrV6> for NetAddr<H>
Source§fn from(socket_addr: SocketAddrV6) -> Self
fn from(socket_addr: SocketAddrV6) -> Self
Converts to this type from the input type.
Source§impl<H: Ord + Host> Ord for NetAddr<H>
impl<H: Ord + Host> Ord for NetAddr<H>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<H: PartialOrd + Host> PartialOrd for NetAddr<H>
impl<H: PartialOrd + Host> PartialOrd for NetAddr<H>
Source§impl ToSocketAddr for NetAddr<IpAddr>
impl ToSocketAddr for NetAddr<IpAddr>
fn to_socket_addr(&self) -> SocketAddr
Source§impl ToSocketAddr for NetAddr<Ipv4Addr>
impl ToSocketAddr for NetAddr<Ipv4Addr>
fn to_socket_addr(&self) -> SocketAddr
Source§impl ToSocketAddr for NetAddr<Ipv6Addr>
impl ToSocketAddr for NetAddr<Ipv6Addr>
fn to_socket_addr(&self) -> SocketAddr
Source§impl ToSocketAddrs for NetAddr<InetHost>
Available on crate feature dns only.
impl ToSocketAddrs for NetAddr<InetHost>
Available on crate feature
dns only.Source§type Iter = IntoIter<SocketAddr>
type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond
to.
Source§fn to_socket_addrs(&self) -> Result<Self::Iter>
fn to_socket_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved
SocketAddrs. Read moreSource§impl ToSocketAddrs for NetAddr<IpAddr>
impl ToSocketAddrs for NetAddr<IpAddr>
Source§type Iter = IntoIter<SocketAddr>
type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond
to.
Source§fn to_socket_addrs(&self) -> Result<Self::Iter>
fn to_socket_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved
SocketAddrs. Read moreimpl<H: Eq + Host> Eq for NetAddr<H>
impl<H: Host> StructuralPartialEq for NetAddr<H>
Auto Trait Implementations§
impl<H> Freeze for NetAddr<H>where
H: Freeze,
impl<H> RefUnwindSafe for NetAddr<H>where
H: RefUnwindSafe,
impl<H> Send for NetAddr<H>where
H: Send,
impl<H> Sync for NetAddr<H>where
H: Sync,
impl<H> Unpin for NetAddr<H>where
H: Unpin,
impl<H> UnwindSafe for NetAddr<H>where
H: UnwindSafe,
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