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

Interface-Local scope.

ยง

LinkLocal = 2

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

Link-Local scope.

ยง

RealmLocal = 3

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

Realm-Local scope.

ยง

AdminLocal = 4

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

Admin-Local scope.

ยง

SiteLocal = 5

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

Site-Local scope.

ยง

Unassigned6 = 6

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

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

ยง

Unassigned7 = 7

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

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

ยง

OrganizationLocal = 8

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

Organization-Local scope.

ยง

Unassigned9 = 9

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

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

ยง

UnassignedA = 10

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

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

ยง

UnassignedB = 11

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

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

ยง

UnassignedC = 12

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

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

ยง

UnassignedD = 13

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

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

ยง

Global = 14

๐Ÿ”ฌThis is a nightly-only experimental API. (ip)

Global scope.

Trait Implementationsยง

Sourceยง

impl Clone for Ipv6MulticastScope

Sourceยง

fn clone(&self) -> Ipv6MulticastScope

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 Debug for Ipv6MulticastScope

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl Hash for Ipv6MulticastScope

Sourceยง

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

Feeds this value into the given Hasher. Read more
1.3.0 ยท Sourceยง

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

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 method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) ยท Sourceยง

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

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) ยท Sourceยง

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

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) ยท Sourceยง

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

Restrict a value to a certain interval. Read more
Sourceยง

impl PartialEq for Ipv6MulticastScope

Sourceยง

fn eq(&self, other: &Ipv6MulticastScope) -> 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 PartialOrd for Ipv6MulticastScope

Sourceยง

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) ยท Sourceยง

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) ยท Sourceยง

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) ยท Sourceยง

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) ยท Sourceยง

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

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

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Sourceยง

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Sourceยง

impl<T> DebugExt<T> for T
where T: Debug,

Sourceยง

impl<T> Downcast for T
where T: Any,

Sourceยง

fn into_any(self: Box<T>) -> Box<dyn Any>

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

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Sourceยง

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> โ“˜

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Sourceยง

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,

Use this to cast from one trait object type to another. Read more
Sourceยง

fn dyn_upcast<T>(self) -> <A as DynCastExtAdvHelper<T, T>>::Target
where A: DynCastExtAdvHelper<T, T, Source = <A as DynCastExtAdvHelper<T, T>>::Target>, T: ?Sized,

Use this to upcast a trait to one of its supertraits. Read more
Sourceยง

fn dyn_cast_adv<F, T>( self, ) -> Result<<A as DynCastExtAdvHelper<F, T>>::Target, <A as DynCastExtAdvHelper<F, T>>::Source>
where A: DynCastExtAdvHelper<F, T>, F: ?Sized, T: ?Sized,

Use this to cast from one trait object type to another. This method is more customizable than the dyn_cast method. Here you can also specify the โ€œsourceโ€ trait from which the cast is defined. This can for example allow using casts from a supertrait of the current trait object. Read more
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>

Use this to cast from one trait object type to another. With this method the type parameter is a config type that uniquely specifies which cast should be preformed. Read more
Sourceยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Sourceยง

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Sourceยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Sourceยง

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Sourceยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Sourceยง

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self> โ“˜

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self> โ“˜

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Sourceยง

fn into_either(self, into_left: bool) -> Either<Self, Self> โ“˜

Converts 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 more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ“˜
where F: FnOnce(&Self) -> bool,

Converts 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
Sourceยง

impl<T> OrdExt<T> for T
where T: Ord + Clone,

Sourceยง

fn update_max(&mut self, new: &T)

Sourceยง

impl<T> Pointable for T

Sourceยง

const ALIGN: usize

The alignment of pointer.
Sourceยง

type Init = T

The type for initializers.
Sourceยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Sourceยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Sourceยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Sourceยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
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.
Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V

Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> โ“˜
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self> โ“˜

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

impl<T> RuleType for T
where T: Copy + Debug + Eq + Hash + Ord,