Skip to main content

Ipv6Scope

Enum Ipv6Scope 

Source
pub enum Ipv6Scope {
    InterfaceLocal,
    LinkLocal,
    RealmLocal,
    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 and updated by RFC 7346.

Variants§

§

InterfaceLocal

The interface-local scope.

§

LinkLocal

The link-local scope.

§

RealmLocal

The realm-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 7436].

§

Unassigned(Ipv6UnassignedScope)

Scopes which are available for local definition by administrators.

Implementations§

Source§

impl Ipv6Scope

Source

pub const MULTICAST_SCOPE_ID_INTERFACE_LOCAL: u8 = 1

The multicast scope ID of an interface-local address, defined in RFC 7346.

The multicast scope ID of a link-local address, defined in RFC 7346.

Source

pub const MULTICAST_SCOPE_ID_REALM_LOCAL: u8 = 3

The multicast scope ID of a realm-local address, defined in RFC 7346.

Source

pub const MULTICAST_SCOPE_ID_ADMIN_LOCAL: u8 = 4

The multicast scope ID of an admin-local address, defined in RFC 7346.

Source

pub const MULTICAST_SCOPE_ID_SITE_LOCAL: u8 = 5

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

Note that site-local addresses are deprecated.

Source

pub const MULTICAST_SCOPE_ID_ORG_LOCAL: u8 = 8

The multicast scope ID of an organization-local address, defined in RFC 7346.

Source

pub const MULTICAST_SCOPE_ID_GLOBAL: u8 = 0xE

The multicast scope ID of global address, defined in RFC 7346.

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 duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Ipv6Scope

Source§

impl Debug for Ipv6Scope

Source§

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

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

impl Eq for Ipv6Scope

Source§

impl PartialEq for Ipv6Scope

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

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 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

Source§

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>,

Source§

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.