Enum net_types::ip::Ipv6

source ·
pub enum Ipv6 {}
Expand description

IPv6.

Ipv6 implements Ip for IPv6.

Note that this type has no value constructor. It is used purely at the type level. Attempting to construct it by calling Default::default will panic.

Implementations§

source§

impl Ipv6

source

pub const LOOPBACK_IPV6_ADDRESS: UnicastAddr<Ipv6Addr> = _

The loopback address represented as a UnicastAddr.

This is equivalent to LOOPBACK_ADDRESS, except that it is a UnicastAddr witness type.

The IPv6 All Nodes multicast address in link-local scope, defined in RFC 4291 Section 2.7.1.

The IPv6 All Routers multicast address in link-local scope, defined in RFC 4291 Section 2.7.1.

source

pub const SITE_LOCAL_UNICAST_SUBNET: Subnet<Ipv6Addr> = _

The (deprecated) subnet of site-local unicast addresses, defined in RFC 3513 Section 2.5.6.

The site-local unicast subnet was deprecated in RFC 3879:

The special behavior of this prefix MUST no longer be supported in new implementations. The prefix MUST NOT be reassigned for other use except by a future IETF standards action… However, router implementations SHOULD be configured to prevent routing of this prefix by default.

source

pub const UNICAST_INTERFACE_IDENTIFIER_BITS: u8 = 64u8

The length, in bits, of the interface identifier portion of unicast IPv6 addresses except for addresses which start with the binary value 000.

According to RFC 4291 Section 2.5.1, “[f]or all unicast addresses, except those that start with the binary value 000, Interface IDs are required to be 64 bits.”

Note that, per RFC 4862 Section 5.5.3:

a future revision of the address architecture [RFC4291] and a future link-type-specific document, which will still be consistent with each other, could potentially allow for an interface identifier of length other than the value defined in the current documents. Thus, an implementation should not assume a particular constant. Rather, it should expect any lengths of interface identifiers.

In other words, this constant may be used to generate addresses or subnet prefix lengths, but should not be used to validate addresses or subnet prefix lengths generated by other software or other machines, as it might be valid for other software or other machines to use an interface identifier length different from this one.

source

pub const FLOW_LABEL_BITS: u8 = 20u8

The length, in bits, of an IPv6 flow label, defined in RFC 6437 Section 2.

Trait Implementations§

source§

impl Clone for Ipv6

source§

fn clone(&self) -> Ipv6

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ipv6

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Ipv6

source§

fn default() -> Ipv6

Returns the “default value” for a type. Read more
source§

impl Hash for Ipv6

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ip for Ipv6

source§

const UNSPECIFIED_ADDRESS: Ipv6Addr = _

The unspecified IPv6 address, defined in RFC 4291 Section 2.5.2.

Per RFC 4291:

The address 0:0:0:0:0:0:0:0 is called the unspecified address. It must never be assigned to any node. It indicates the absence of an address. One example of its use is in the Source Address field of any IPv6 packets sent by an initializing host before it has learned its own address.

The unspecified address must not be used as the destination address of IPv6 packets or in IPv6 Routing headers. An IPv6 packet with a source address of unspecified must never be forwarded by an IPv6 router.

source§

const LOOPBACK_ADDRESS: SpecifiedAddr<Ipv6Addr> = _

The loopback IPv6 address, defined in RFC 4291 Section 2.5.3.

Per RFC 4291:

The unicast address 0:0:0:0:0:0:0:1 is called the loopback address. It may be used by a node to send an IPv6 packet to itself. It must not be assigned to any physical interface. It is treated as having Link-Local scope, and may be thought of as the Link-Local unicast address of a virtual interface (typically called the “loopback interface”) to an imaginary link that goes nowhere.

The loopback address must not be used as the source address in IPv6 packets that are sent outside of a single node. An IPv6 packet with a destination address of loopback must never be sent outside of a single node and must never be forwarded by an IPv6 router. A packet received on an interface with a destination address of loopback must be dropped.

source§

const LOOPBACK_SUBNET: Subnet<Ipv6Addr> = _

The subnet of loopback IPv6 addresses, defined in RFC 4291 Section 2.4.

Note that the IPv6 loopback subnet is a /128, meaning that it contains only one address - the LOOPBACK_ADDRESS.

source§

const MULTICAST_SUBNET: Subnet<Ipv6Addr> = _

The subnet of multicast IPv6 addresses, defined in RFC 4291 Section 2.7.

The subnet of link-local unicast addresses, defined in RFC 4291 Section 2.4.

Note that multicast addresses can also be link-local. However, there is no single subnet of link-local multicast addresses. For more details on link-local multicast addresses, see RFC 4291 Section 2.7.

The IPv6 minimum link MTU, defined in RFC 8200 Section 5.

Per RFC 8200:

IPv6 requires that every link in the Internet have an MTU of 1280 octets or greater. This is known as the IPv6 minimum link MTU. On any link that cannot convey a 1280-octet packet in one piece, link- specific fragmentation and reassembly must be provided at a layer below IPv6.

source§

const VERSION: IpVersion = IpVersion::V6

The IP version. Read more
source§

const VERSION_MARKER: IpVersionMarker<Self> = _

The zero-sized-type IP version marker.
source§

const NAME: &'static str = "IPv6"

“IPv4” or “IPv6”.
§

type Addr = Ipv6Addr

The address type for this IP version. Read more
source§

fn map_ip<In: GenericOverIp<Self, Type = In> + GenericOverIp<Ipv4> + GenericOverIp<Ipv6>, Out: GenericOverIp<Self, Type = Out> + GenericOverIp<Ipv4> + GenericOverIp<Ipv6>>( input: In, _v4: impl FnOnce(<In as GenericOverIp<Ipv4>>::Type) -> <Out as GenericOverIp<Ipv4>>::Type, v6: impl FnOnce(<In as GenericOverIp<Ipv6>>::Type) -> <Out as GenericOverIp<Ipv6>>::Type ) -> Out

Apply one of the given functions to the input and return the result. Read more
source§

impl Ord for Ipv6

source§

fn cmp(&self, other: &Ipv6) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Ipv6

source§

fn eq(&self, other: &Ipv6) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Ipv6

source§

fn partial_cmp(&self, other: &Ipv6) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Ipv6

source§

impl Eq for Ipv6

source§

impl StructuralPartialEq for Ipv6

Auto Trait Implementations§

§

impl RefUnwindSafe for Ipv6

§

impl Send for Ipv6

§

impl Sync for Ipv6

§

impl Unpin for Ipv6

§

impl UnwindSafe for Ipv6

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.