Skip to main content

IpScope

Enum IpScope 

Source
pub enum IpScope {
    Global,
    Local,
}
Expand description

How far an IP address reaches.

Variants§

§

Global

An address outside every range listed on Local.

Reserved ranges that are neither private nor host-scoped are not separated out: 192.0.2.1 is documentation space (RFC 5737) and reads as Global here, because the question this answers is whether the address was set aside for use inside a network, not whether some route to it exists today.

§

Local

An address that is meaningful only inside a network, or only on the host that is asked:

RangeReserved by
10/8, 172.16/12, 192.168/16RFC 1918 §3
100.64/10RFC 6598 §7
169.254/16RFC 3927 §2.1
127/8, 0/8RFC 1122 §3.2.1.3
255.255.255.255RFC 919 §7
224.0.0/24RFC 5771 §4
239/8RFC 2365 §4
198.18/15RFC 2544 §C.2.2
fc00::/7RFC 4193 §3
fe80::/10RFC 4291 §2.5.6
fec0::/10RFC 3879 §2
::1, ::RFC 4291 §2.5.3, §2.5.2
ff00::/8 below global scopeRFC 4291 §2.7

An address that embeds an IPv4 one, in either the mapped form (RFC 4291 §2.5.5.2) or the deprecated compatible form (§2.5.5.1), reports the reach of the address it holds, so one host does not classify two ways for being written two ways.

Multicast is not here for being multicast: an IPv6 group carries its scope in the address and only 0xE is global, and of IPv4 multicast only the two blocks above are bounded. 224.0.1.1 and 233.1.2.3 are routable and read as Global.

Trait Implementations§

Source§

impl Clone for IpScope

Source§

fn clone(&self) -> Self

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 Copy for IpScope

Source§

impl Debug for IpScope

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for IpScope

Source§

impl Hash for IpScope

Source§

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

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 PartialEq for IpScope

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for IpScope

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.