Type Alias Ipv4DeviceAddr

Source
pub type Ipv4DeviceAddr = NonMulticastAddr<NonMappedAddr<SpecifiedAddr<Ipv4Addr>>>;
Expand description

An Ipv4 address that witnesses properties needed to be assigned to a device.

These witnesses are the same that are held by IpDeviceAddr, however that type cannot be used here directly because we need Ipv4DeviceAddr to implement Witness<Ipv4Addr>. That implementation is not present for our new type IpDeviceAddr which wraps the true witnesses from the net-types crate.

Aliased Type§

struct Ipv4DeviceAddr(/* private fields */);

Implementations

Source§

impl<A> NonMulticastAddr<A>

Source

pub const unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<A>

Constructs a new NonMulticastAddr without checking to see if addr is actually non-multicast.

§Safety

It is up to the caller to make sure that addr is non-multicast to avoid breaking the guarantees of NonMulticastAddr. See NonMulticastAddr for more details.

Source§

impl<A> NonMulticastAddr<A>

Source

pub fn new(addr: A) -> Option<NonMulticastAddr<A>>

Constructs a new NonMulticastAddr.

new returns None if !addr.is_non_multicast().

Source

pub fn from_witness<W>(addr: W) -> Option<NonMulticastAddr<A>>
where W: Witness<A>,

Constructs a new NonMulticastAddr from a witness type.

from_witness(witness) is equivalent to new(witness.into_addr()).

Trait Implementations

Source§

impl<A> AsRef<A> for NonMulticastAddr<A>

Source§

fn as_ref(&self) -> &A

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<A> AsRef<A> for NonMulticastAddr<NonMappedAddr<A>>

Source§

fn as_ref(&self) -> &A

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<A> AsRef<A> for NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>

Source§

fn as_ref(&self) -> &A

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<A> AsRef<NonMulticastAddr<A>> for NonMulticastAddr<A>

Source§

fn as_ref(&self) -> &NonMulticastAddr<A>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<A> Clone for NonMulticastAddr<A>
where A: Clone,

Source§

fn clone(&self) -> NonMulticastAddr<A>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A> Debug for NonMulticastAddr<A>
where A: Debug,

Source§

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

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

impl<A> Deref for NonMulticastAddr<A>

Source§

type Target = A

The resulting type after dereferencing.
Source§

fn deref(&self) -> &A

Dereferences the value.
Source§

impl<A> Display for NonMulticastAddr<A>
where A: Display,

Source§

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

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

impl<A> Hash for NonMulticastAddr<A>
where A: Hash,

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<A> Ord for NonMulticastAddr<A>
where A: Ord,

Source§

fn cmp(&self, other: &NonMulticastAddr<A>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

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

Restrict a value to a certain interval. Read more
Source§

impl<A> PartialEq for NonMulticastAddr<A>
where A: PartialEq,

Source§

fn eq(&self, other: &NonMulticastAddr<A>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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<A> PartialOrd for NonMulticastAddr<A>
where A: PartialOrd,

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · 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 · 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 · 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 · 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<A> TransposableWitness<A> for NonMulticastAddr<A>

Source§

type Map<T> = NonMulticastAddr<T>

Maps the type wrapped by this witness.
Source§

impl<A> Witness<A> for NonMulticastAddr<A>

Source§

fn new(addr: A) -> Option<NonMulticastAddr<A>>

Constructs a new witness type. Read more
Source§

unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<A>

Constructs a new witness type without checking to see if addr actually satisfies the required property. Read more
Source§

fn into_addr(self) -> A

Consumes this witness and returns the contained A. Read more
Source§

fn from_witness<W>(addr: W) -> Option<Self>
where W: Witness<A>,

Constructs a new witness type from an existing witness type. Read more
Source§

fn get(&self) -> A
where A: Copy,

Gets a copy of the address.
Source§

fn transpose<T>(self) -> <A as TransposableWitness<T>>::Map<Self::Map<T>>
where Self: TransposableWitness<A>, A: TransposableWitness<T>, Self::Map<T>: Witness<T>, <A as TransposableWitness<T>>::Map<Self::Map<T>>: Witness<Self::Map<T>>,

Transposes this witness type with another witness type layered inside of it. (e.g. UnicastAddr<SpecifiedAddr> -> SpecifiedAddr<UnicastAddr>)
Source§

impl<A> Witness<A> for NonMulticastAddr<NonMappedAddr<A>>

Source§

fn new(addr: A) -> Option<NonMulticastAddr<NonMappedAddr<A>>>

Constructs a new witness type. Read more
Source§

unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<NonMappedAddr<A>>

Constructs a new witness type without checking to see if addr actually satisfies the required property. Read more
Source§

fn into_addr(self) -> A

Consumes this witness and returns the contained A. Read more
Source§

fn from_witness<W>(addr: W) -> Option<Self>
where W: Witness<A>,

Constructs a new witness type from an existing witness type. Read more
Source§

fn get(&self) -> A
where A: Copy,

Gets a copy of the address.
Source§

fn transpose<T>(self) -> <A as TransposableWitness<T>>::Map<Self::Map<T>>
where Self: TransposableWitness<A>, A: TransposableWitness<T>, Self::Map<T>: Witness<T>, <A as TransposableWitness<T>>::Map<Self::Map<T>>: Witness<Self::Map<T>>,

Transposes this witness type with another witness type layered inside of it. (e.g. UnicastAddr<SpecifiedAddr> -> SpecifiedAddr<UnicastAddr>)
Source§

impl<A> Witness<A> for NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>

Source§

fn new(addr: A) -> Option<NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>>

Constructs a new witness type. Read more
Source§

unsafe fn new_unchecked( addr: A, ) -> NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>

Constructs a new witness type without checking to see if addr actually satisfies the required property. Read more
Source§

fn into_addr(self) -> A

Consumes this witness and returns the contained A. Read more
Source§

fn from_witness<W>(addr: W) -> Option<Self>
where W: Witness<A>,

Constructs a new witness type from an existing witness type. Read more
Source§

fn get(&self) -> A
where A: Copy,

Gets a copy of the address.
Source§

fn transpose<T>(self) -> <A as TransposableWitness<T>>::Map<Self::Map<T>>
where Self: TransposableWitness<A>, A: TransposableWitness<T>, Self::Map<T>: Witness<T>, <A as TransposableWitness<T>>::Map<Self::Map<T>>: Witness<Self::Map<T>>,

Transposes this witness type with another witness type layered inside of it. (e.g. UnicastAddr<SpecifiedAddr> -> SpecifiedAddr<UnicastAddr>)
Source§

impl<A> Copy for NonMulticastAddr<A>
where A: Copy,

Source§

impl<A> Eq for NonMulticastAddr<A>
where A: Eq,

Source§

impl<A> StructuralPartialEq for NonMulticastAddr<A>