Enum Ipv6MulticastScope

enum Ipv6MulticastScope

Scope of an IPv6 multicast address as defined in IETF RFC 7346 section 2.

Stability Guarantees

Not all possible values for a multicast scope have been assigned. Future RFCs may introduce new scopes, which will be added as variants to this enum; because of this the enum is marked as #[non_exhaustive].

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(_) => println!("Unknown scope"),
    None => println!("Not a multicast address!")
}

Variants

InterfaceLocal

Interface-Local scope.

LinkLocal

Link-Local scope.

RealmLocal

Realm-Local scope.

AdminLocal

Admin-Local scope.

SiteLocal

Site-Local scope.

OrganizationLocal

Organization-Local scope.

Global

Global scope.

Implementations

impl Clone for Ipv6MulticastScope

fn clone(self: &Self) -> Ipv6MulticastScope

impl Copy for Ipv6MulticastScope

impl Debug for Ipv6MulticastScope

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

impl Eq for Ipv6MulticastScope

impl Freeze for Ipv6MulticastScope

impl Hash for Ipv6MulticastScope

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

impl PartialEq for Ipv6MulticastScope

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

impl RefUnwindSafe for Ipv6MulticastScope

impl Send for Ipv6MulticastScope

impl StructuralPartialEq for Ipv6MulticastScope

impl Sync for Ipv6MulticastScope

impl Unpin for Ipv6MulticastScope

impl UnsafeUnpin for Ipv6MulticastScope

impl UnwindSafe for Ipv6MulticastScope

impl<T> Any for Ipv6MulticastScope

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Ipv6MulticastScope

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Ipv6MulticastScope

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Ipv6MulticastScope

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Ipv6MulticastScope

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Ipv6MulticastScope

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for Ipv6MulticastScope

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Ipv6MulticastScope

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>