Enum nix::sys::socket::InetAddr

pub enum InetAddr {    
    V4(libc::sockaddr_in),
    V6(libc::sockaddr_in6),
}

Variants

V4(libc::sockaddr_in)
libc::sockaddr_in
V6(libc::sockaddr_in6)
libc::sockaddr_in6

Implementations

impl InetAddr
pub fn from_std(std: &net::SocketAddr) -> InetAddr
pub fn new(ip: IpAddr, port: u16) -> InetAddr
pub const fn ip(&Self) -> IpAddr

Gets the IP address associated with this socket address.

pub const fn port(&Self) -> u16

Gets the port number associated with this socket address

pub fn to_std(&Self) -> net::SocketAddr
pub fn to_str(&Self) -> String

Trait Implementations

impl Clone for InetAddr
fn clone(&Self) -> InetAddr
impl Copy for InetAddr
impl Debug for InetAddr
fn fmt(&Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Display for InetAddr
fn fmt(&Self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Eq for InetAddr
impl Hash for InetAddr
fn hash<__H: $crate::hash::Hasher>(&Self, state: &mut __H) -> ()
impl PartialEq<InetAddr> for InetAddr
fn eq(&Self, other: &InetAddr) -> bool
fn ne(&Self, other: &InetAddr) -> bool

Auto Trait Implementations

impl Send for InetAddr
impl Sync for InetAddr
impl Unpin for InetAddr
impl UnwindSafe for InetAddr

Blanket Implementations

impl<T> Any for T
where
    T: 'static + ?Sized,
fn type_id(&Self) -> TypeId
impl<T> Borrow<T> for T
where
    T: ?Sized,
fn borrow(&Self) -> &T
impl<T> BorrowMut<T> for T
where
    T: ?Sized,
fn borrow_mut(&mut Self) -> &mut T
impl<T> From<T> for T
fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for T
where
    U: From<T>,
fn into(Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

impl<T> ToOwned for T
where
    T: Clone,
type Owned = T
fn to_owned(&Self) -> T
fn clone_into(&Self, target: &mut T)
impl<T> ToString for T
where
    T: Display + ?Sized,
fn to_string(&Self) -> String
impl<T, U> TryFrom<U> for T
where
    U: Into<T>,
type Error = Infallible
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for T
where
    U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn try_into(Self) -> Result<U, <U as TryFrom<T>>::Error>