[][src]Struct posix_socket::Inet4SocketAddress

#[repr(C)]pub struct Inet4SocketAddress { /* fields omitted */ }

IPv4 socket address.

This includes an IPv4 address and a 16-bit port number.

Implementations

impl Inet4SocketAddress[src]

pub fn new(ip: &Ipv4Addr, port: u16) -> Self[src]

Create an IPv4 socket address from an IP address and a port number.

pub fn from_raw(inner: sockaddr_in) -> Self[src]

Create an IPv4 socket address from a libc::sockaddr_in.

pub fn into_raw(self) -> sockaddr_in[src]

Convert the [SocketAddress] into raw libc parts.

pub fn ip(&self) -> Ipv4Addr[src]

Get the IP address associated with the socket address.

pub fn set_ip(&mut self, ip: Ipv4Addr)[src]

Set the IP address associated with the socket address.

pub fn port(&self) -> u16[src]

Get the port number associated with the socket address.

pub fn set_port(&mut self, port: u16)[src]

Set the port number associated with the socket address.

Trait Implementations

impl AsSocketAddress for Inet4SocketAddress[src]

impl Clone for Inet4SocketAddress[src]

impl<'_> From<&'_ Inet4SocketAddress> for SocketAddress[src]

impl<'_> From<&'_ Inet4SocketAddress> for SocketAddrV4[src]

impl<'_> From<&'_ SocketAddrV4> for Inet4SocketAddress[src]

impl From<Inet4SocketAddress> for SocketAddress[src]

impl From<Inet4SocketAddress> for SocketAddrV4[src]

impl From<SocketAddrV4> for Inet4SocketAddress[src]

impl SpecificSocketAddress for Inet4SocketAddress[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.