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
}ip)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
ip)Interface-Local scope.
LinkLocal = 2
ip)Link-Local scope.
RealmLocal = 3
ip)Realm-Local scope.
AdminLocal = 4
ip)Admin-Local scope.
SiteLocal = 5
ip)Site-Local scope.
Unassigned6 = 6
ip)Scope 6. Unassigned, available for administrators to define additional multicast regions.
Unassigned7 = 7
ip)Scope 7. Unassigned, available for administrators to define additional multicast regions.
OrganizationLocal = 8
ip)Organization-Local scope.
Unassigned9 = 9
ip)Scope 9. Unassigned, available for administrators to define additional multicast regions.
UnassignedA = 10
ip)Scope A. Unassigned, available for administrators to define additional multicast regions.
UnassignedB = 11
ip)Scope B. Unassigned, available for administrators to define additional multicast regions.
UnassignedC = 12
ip)Scope C. Unassigned, available for administrators to define additional multicast regions.
UnassignedD = 13
ip)Scope D. Unassigned, available for administrators to define additional multicast regions.
Global = 14
ip)Global scope.
Trait Implementations§
Source§impl Clone for Ipv6MulticastScope
impl Clone for Ipv6MulticastScope
Source§fn clone(&self) -> Ipv6MulticastScope
fn clone(&self) -> Ipv6MulticastScope
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Ipv6MulticastScope
impl Debug for Ipv6MulticastScope
Source§impl Hash for Ipv6MulticastScope
impl Hash for Ipv6MulticastScope
Source§impl Ord for Ipv6MulticastScope
impl Ord for Ipv6MulticastScope
Source§fn cmp(&self, other: &Ipv6MulticastScope) -> Ordering
fn cmp(&self, other: &Ipv6MulticastScope) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Ipv6MulticastScope
impl PartialEq for Ipv6MulticastScope
Source§impl PartialOrd for Ipv6MulticastScope
impl PartialOrd for Ipv6MulticastScope
impl Copy for Ipv6MulticastScope
impl Eq for Ipv6MulticastScope
impl StructuralPartialEq for Ipv6MulticastScope
Auto Trait Implementations§
impl Freeze for Ipv6MulticastScope
impl RefUnwindSafe for Ipv6MulticastScope
impl Send for Ipv6MulticastScope
impl Sync for Ipv6MulticastScope
impl Unpin for Ipv6MulticastScope
impl UnsafeUnpin for Ipv6MulticastScope
impl UnwindSafe for Ipv6MulticastScope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.