Skip to main content

Ipv6MulticastScope

Enum Ipv6MulticastScope 

Source
pub enum Ipv6MulticastScope {
Show 14 variants InterfaceLocal = 1, LinkLocal = 2, RealmLocal = 3, AdminLocal = 4, SiteLocal = 5, Unassigned6 = 6, Unassigned7 = 7, OrganizationLocal = 8, Unassigned9 = 9, UnassignedA = 10, UnassignedB = 11, UnassignedC = 12, UnassignedD = 13, Global = 14, // some variants omitted
}
🔬This is a nightly-only experimental API. (ip #27709)
Expand description

Scope of an IPv6 multicast address as defined in IETF RFC 7346 section 2, which updates IETF RFC 4291 section 2.7.

§Stability Guarantees

Scopes 0 and F are currently reserved by IETF, and may be assigned in the future. For this reason, the enum variants for those two scopes are not currently nameable. You can still check for them in your code using as casts.

§Examples

#![feature(ip)]

use std::net::Ipv6Addr;
use std::net::Ipv6MulticastScope::*;

// An IPv6 multicast address with global scope (`ff0e::`).
let address = Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0);

// Will print "Global scope".
match address.multicast_scope() {
    Some(InterfaceLocal) => println!("Interface-Local scope"),
    Some(LinkLocal) => println!("Link-Local scope"),
    Some(RealmLocal) => println!("Realm-Local scope"),
    Some(AdminLocal) => println!("Admin-Local scope"),
    Some(SiteLocal) => println!("Site-Local scope"),
    Some(OrganizationLocal) => println!("Organization-Local scope"),
    Some(Global) => println!("Global scope"),
    Some(s) => {
        let snum = s as u8;
        if matches!(0x0 | 0xF, snum) {
            println!("Reserved scope {snum:X}")
        } else {
            println!("Unassigned scope {snum:X}")
        }
    }
    None => println!("Not a multicast address!")
}

Variants§

§

InterfaceLocal = 1

🔬This is a nightly-only experimental API. (ip #27709)

Interface-Local scope.

§

LinkLocal = 2

🔬This is a nightly-only experimental API. (ip #27709)

Link-Local scope.

§

RealmLocal = 3

🔬This is a nightly-only experimental API. (ip #27709)

Realm-Local scope.

§

AdminLocal = 4

🔬This is a nightly-only experimental API. (ip #27709)

Admin-Local scope.

§

SiteLocal = 5

🔬This is a nightly-only experimental API. (ip #27709)

Site-Local scope.

§

Unassigned6 = 6

🔬This is a nightly-only experimental API. (ip #27709)

Scope 6. Unassigned, available for administrators to define additional multicast regions.

§

Unassigned7 = 7

🔬This is a nightly-only experimental API. (ip #27709)

Scope 7. Unassigned, available for administrators to define additional multicast regions.

§

OrganizationLocal = 8

🔬This is a nightly-only experimental API. (ip #27709)

Organization-Local scope.

§

Unassigned9 = 9

🔬This is a nightly-only experimental API. (ip #27709)

Scope 9. Unassigned, available for administrators to define additional multicast regions.

§

UnassignedA = 10

🔬This is a nightly-only experimental API. (ip #27709)

Scope A. Unassigned, available for administrators to define additional multicast regions.

§

UnassignedB = 11

🔬This is a nightly-only experimental API. (ip #27709)

Scope B. Unassigned, available for administrators to define additional multicast regions.

§

UnassignedC = 12

🔬This is a nightly-only experimental API. (ip #27709)

Scope C. Unassigned, available for administrators to define additional multicast regions.

§

UnassignedD = 13

🔬This is a nightly-only experimental API. (ip #27709)

Scope D. Unassigned, available for administrators to define additional multicast regions.

§

Global = 14

🔬This is a nightly-only experimental API. (ip #27709)

Global scope.

Trait Implementations§

Source§

impl Clone for Ipv6MulticastScope

Source§

fn clone(&self) -> Ipv6MulticastScope

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Returns a duplicate of the value. Read more
1.0.0 · Source§

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

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Performs copy-assignment from source. Read more
Source§

impl Debug for Ipv6MulticastScope

Source§

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

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Formats the value using the given formatter. Read more
Source§

impl Hash for Ipv6MulticastScope

Source§

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

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Feeds this value into the given Hasher. Read more
1.3.0 · Source§

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

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Ipv6MulticastScope

Source§

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

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
This method returns an Ordering between self and other. Read more
1.21.0 · Source§

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

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Compares and returns the maximum of two values. Read more
1.21.0 · Source§

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

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
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,

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Ipv6MulticastScope

Source§

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

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Ipv6MulticastScope

Source§

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

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
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 item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
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 item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
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 item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
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 item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for Ipv6MulticastScope

Source§

impl Eq for Ipv6MulticastScope

Source§

impl StructuralPartialEq for Ipv6MulticastScope

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
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

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
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 #126799)
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).

Calls U::from(self).

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

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>

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
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>

This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Performs the conversion.