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 (const: unstable) ยท 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 (const: unstable) ยท 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ยงfn eq(&self, other: &Ipv6MulticastScope) -> bool
fn eq(&self, other: &Ipv6MulticastScope) -> bool
self and other values to be equal, and is used by ==.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,
Sourceยงimpl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Sourceยงimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Sourceยงfn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Sourceยงfn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Sourceยงfn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Anyโs vtable from &Traitโs.Sourceยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Anyโs vtable from &mut Traitโs.Sourceยงimpl<T> DowncastSync for T
impl<T> DowncastSync for T
Sourceยงimpl<A> DynCastExt for A
impl<A> DynCastExt for A
Sourceยงfn dyn_cast<T>(
self,
) -> Result<<A as DynCastExtHelper<T>>::Target, <A as DynCastExtHelper<T>>::Source>where
A: DynCastExtHelper<T>,
T: ?Sized,
fn dyn_cast<T>(
self,
) -> Result<<A as DynCastExtHelper<T>>::Target, <A as DynCastExtHelper<T>>::Source>where
A: DynCastExtHelper<T>,
T: ?Sized,
Sourceยงfn dyn_upcast<T>(self) -> <A as DynCastExtAdvHelper<T, T>>::Target
fn dyn_upcast<T>(self) -> <A as DynCastExtAdvHelper<T, T>>::Target
Sourceยงfn dyn_cast_adv<F, T>(
self,
) -> Result<<A as DynCastExtAdvHelper<F, T>>::Target, <A as DynCastExtAdvHelper<F, T>>::Source>
fn dyn_cast_adv<F, T>( self, ) -> Result<<A as DynCastExtAdvHelper<F, T>>::Target, <A as DynCastExtAdvHelper<F, T>>::Source>
Sourceยงfn dyn_cast_with_config<C>(
self,
) -> Result<<A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Target, <A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Source>where
C: DynCastConfig,
A: DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>,
fn dyn_cast_with_config<C>(
self,
) -> Result<<A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Target, <A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Source>where
C: DynCastConfig,
A: DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>,
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self> โ
fn instrument(self, span: Span) -> Instrumented<Self> โ
Sourceยงfn in_current_span(self) -> Instrumented<Self> โ
fn in_current_span(self) -> Instrumented<Self> โ
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self> โ
fn into_either(self, into_left: bool) -> Either<Self, Self> โ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more