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)

IPv6(IPv6)

Unix(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

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

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

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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.