Enum net_types::ip::Ipv6Scope

source ·
pub enum Ipv6Scope {
    InterfaceLocal,
    LinkLocal,
    AdminLocal,
    SiteLocal,
    OrganizationLocal,
    Global,
    Reserved(Ipv6ReservedScope),
    Unassigned(Ipv6UnassignedScope),
}
Expand description

The list of IPv6 scopes.

These scopes are defined by RFC 4291 Section 2.7.

Variants§

§

InterfaceLocal

The interface-local scope.

§

LinkLocal

The link-local scope.

§

AdminLocal

The admin-local scope.

§

SiteLocal

The (deprecated) site-local scope.

The site-local scope was deprecated in RFC 3879. While this scope is returned for both site-local unicast and site-local multicast addresses, RFC 3879 says the following about site-local unicast addresses in particular (“this prefix” refers to the site-local unicast subnet):

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.

§

OrganizationLocal

The organization-local scope.

§

Global

The global scope.

§

Reserved(Ipv6ReservedScope)

Scopes which are reserved for future use by RFC 4291 Section 2.7.

§

Unassigned(Ipv6UnassignedScope)

Scopes which are available for local definition by administrators.

Implementations§

source§

impl Ipv6Scope

source

pub const MULTICAST_SCOPE_ID_INTERFACE_LOCAL: u8 = 1u8

The multicast scope ID of an interface-local address, defined in RFC 4291 Section 2.7.

The multicast scope ID of a link-local address, defined in RFC 4291 Section 2.7.

source

pub const MULTICAST_SCOPE_ID_ADMIN_LOCAL: u8 = 4u8

The multicast scope ID of an admin-local address, defined in RFC 4291 Section 2.7.

source

pub const MULTICAST_SCOPE_ID_SITE_LOCAL: u8 = 5u8

The multicast scope ID of a (deprecated) site-local address, defined in RFC 4291 Section 2.7.

Note that site-local addresses are deprecated.

source

pub const MULTICAST_SCOPE_ID_ORG_LOCAL: u8 = 8u8

The multicast scope ID of an organization-local address, defined in RFC 4291 Section 2.7.

source

pub const MULTICAST_SCOPE_ID_GLOBAL: u8 = 14u8

The multicast scope ID of global address, defined in RFC 4291 Section 2.7.

source

pub fn multicast_scope_id(&self) -> u8

The ID used to indicate this scope in a multicast IPv6 address.

Per RFC 4291 Section 2.7, the bits of a multicast IPv6 address are laid out as follows:

|   8    |  4 |  4 |                  112 bits                   |
+------ -+----+----+---------------------------------------------+
|11111111|flgs|scop|                  group ID                   |
+--------+----+----+---------------------------------------------+

The 4-bit scop field encodes the scope of the address. multicast_scope_id returns the numerical value used to encode this scope in the scop field of a multicast address.

Trait Implementations§

source§

impl Clone for Ipv6Scope

source§

fn clone(&self) -> Ipv6Scope

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 Ipv6Scope

source§

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

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

impl PartialEq for Ipv6Scope

source§

fn eq(&self, other: &Ipv6Scope) -> 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 Scope for Ipv6Scope

source§

fn can_have_zone(&self) -> bool

Can addresses in this scope have an associated zone?
source§

impl Copy for Ipv6Scope

source§

impl Eq for Ipv6Scope

source§

impl StructuralPartialEq for Ipv6Scope

Auto Trait Implementations§

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.