Enum ppp::v2::Addresses[][src]

pub enum Addresses {
    Unspecified,
    IPv4(IPv4),
    IPv6(IPv6),
    Unix(Unix),
}
Expand description

The source and destination address information for a given AddressFamily.

Examples

use ppp::v2::{Addresses, AddressFamily};
use std::net::SocketAddr;

let addresses: Addresses = ("127.0.0.1:80".parse::<SocketAddr>().unwrap(), "192.168.1.1:443".parse::<SocketAddr>().unwrap()).into();

assert_eq!(addresses.address_family(), AddressFamily::IPv4);

Variants

Unspecified

IPv4(IPv4)

Tuple Fields

0: IPv4

IPv6(IPv6)

Tuple Fields

0: IPv6

Unix(Unix)

Tuple Fields

0: Unix

Implementations

The AddressFamily for this Addresses.

The length in bytes of the Addresses in the Header’s payload.

Tests whether the Addresses consume any space in the Header’s payload. AddressFamily::Unspecified does not require any bytes, and always returns true.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Write this instance to the given Writer. The Writer returns an IO error when an individual byte slice is longer than u16::MAX. However, the total length of the buffer may exceed u16::MAX. Read more

Writes this instance to a temporary buffer and returns the buffer.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.