pub struct AddrInfoNode<'a> { /* private fields */ }Expand description
A single address node from an AddrInfoResults.
Implementations§
Source§impl AddrInfoNode<'_>
impl AddrInfoNode<'_>
Sourcepub fn family(&self) -> AddressFamily
pub fn family(&self) -> AddressFamily
Returns the address family (AF_INET or AF_INET6).
Sourcepub fn socktype(&self) -> i32
pub fn socktype(&self) -> i32
Returns the socket type, e.g. libc::SOCK_STREAM (TCP) or libc::SOCK_DGRAM (UDP).
0 if unspecified.
Sourcepub fn protocol(&self) -> i32
pub fn protocol(&self) -> i32
Returns the protocol number, e.g. libc::IPPROTO_TCP or libc::IPPROTO_UDP.
0 if unspecified.
Sourcepub fn socket_addr(&self) -> Option<SocketAddr>
pub fn socket_addr(&self) -> Option<SocketAddr>
Returns the socket address (IP + port) for this node.
Trait Implementations§
Source§impl<'a> Clone for AddrInfoNode<'a>
impl<'a> Clone for AddrInfoNode<'a>
Source§fn clone(&self) -> AddrInfoNode<'a>
fn clone(&self) -> AddrInfoNode<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for AddrInfoNode<'a>
Source§impl Debug for AddrInfoNode<'_>
impl Debug for AddrInfoNode<'_>
Source§impl Display for AddrInfoNode<'_>
impl Display for AddrInfoNode<'_>
impl Send for AddrInfoNode<'_>
impl Sync for AddrInfoNode<'_>
Auto Trait Implementations§
impl<'a> Freeze for AddrInfoNode<'a>
impl<'a> RefUnwindSafe for AddrInfoNode<'a>
impl<'a> Unpin for AddrInfoNode<'a>
impl<'a> UnsafeUnpin for AddrInfoNode<'a>
impl<'a> UnwindSafe for AddrInfoNode<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more