pub enum Ipv6MulticastScope {
Show 16 variants
#[doc(hidden)] Reserved0 = 0,
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,
#[doc(hidden)] ReservedF = 15,
}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§
#[doc(hidden)]Reserved0 = 0
ip_multicast_reserved)Reserved by IETF.
InterfaceLocal = 1
ip #27709)Interface-Local scope.
LinkLocal = 2
ip #27709)Link-Local scope.
RealmLocal = 3
ip #27709)Realm-Local scope.
AdminLocal = 4
ip #27709)Admin-Local scope.
SiteLocal = 5
ip #27709)Site-Local scope.
Unassigned6 = 6
ip #27709)Scope 6. Unassigned, available for administrators to define additional multicast regions.
Unassigned7 = 7
ip #27709)Scope 7. Unassigned, available for administrators to define additional multicast regions.
OrganizationLocal = 8
ip #27709)Organization-Local scope.
Unassigned9 = 9
ip #27709)Scope 9. Unassigned, available for administrators to define additional multicast regions.
UnassignedA = 10
ip #27709)Scope A. Unassigned, available for administrators to define additional multicast regions.
UnassignedB = 11
ip #27709)Scope B. Unassigned, available for administrators to define additional multicast regions.
UnassignedC = 12
ip #27709)Scope C. Unassigned, available for administrators to define additional multicast regions.
UnassignedD = 13
ip #27709)Scope D. Unassigned, available for administrators to define additional multicast regions.
Global = 14
ip #27709)Global scope.
#[doc(hidden)]ReservedF = 15
ip_multicast_reserved)Reserved by IETF.
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 Eq for Ipv6MulticastScope
impl Eq for Ipv6MulticastScope
Source§#[doc(hidden)]fn assert_fields_are_eq(&self)
#[doc(hidden)]fn assert_fields_are_eq(&self)
derive_eq_internals)1.0.0 · Source§#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
implementation detail of #[derive(Eq)]
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
Source§fn partial_cmp(&self, other: &Ipv6MulticastScope) -> Option<Ordering>
fn partial_cmp(&self, other: &Ipv6MulticastScope) -> Option<Ordering>
Source§#[doc(hidden)]fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)]fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
partial_ord_chaining_methods)self == other, returns ControlFlow::Continue(()).
Otherwise, returns ControlFlow::Break(self < other). Read moreSource§#[doc(hidden)]fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)]fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
partial_ord_chaining_methods)__chaining_lt, but for <= instead of <.Source§#[doc(hidden)]fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)]fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
partial_ord_chaining_methods)__chaining_lt, but for > instead of <.Source§#[doc(hidden)]fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)]fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
partial_ord_chaining_methods)__chaining_lt, but for >= instead of <.impl Copy for Ipv6MulticastScope
impl StructuralPartialEq for Ipv6MulticastScope
impl TrivialClone 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,
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
ptr_alignment_type #102070)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
sized_type_properties)[Self]. Read more