Struct net_types::NonMappedAddr

source ·
pub struct NonMappedAddr<A>(/* private fields */);
Expand description

An address which is guaranteed to be non_mapped.

NonMappedAddr wraps an address of type A and guarantees that it is a non_mapped address. Note that this guarantee is contingent on a correct implementation of the MappedAddress trait. Since that trait is not unsafe, unsafe code may NOT rely on this guarantee for its soundness.

Implementations§

source§

impl<A: MappedAddress> NonMappedAddr<A>

source

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

Constructs a new NonMappedAddr.

new returns None if !addr.is_non_mapped().

source

pub fn from_witness<W: Witness<A>>(addr: W) -> Option<NonMappedAddr<A>>

Constructs a new NonMappedAddr from a witness type.

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

source§

impl<A> NonMappedAddr<A>

source

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

Constructs a new NonMappedAddr without checking to see if addr is actually non_mapped.

§Safety

It is up to the caller to make sure that addr is non_mapped to avoid breaking the guarantees of NonMappedAddr. See NonMappedAddr for more details.

Trait Implementations§

source§

impl<A: MappedAddress> AsRef<A> for NonMappedAddr<A>

source§

fn as_ref(&self) -> &A

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

impl<A: MappedAddress + BroadcastAddress> AsRef<A> for NonMappedAddr<BroadcastAddr<A>>

source§

fn as_ref(&self) -> &A

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

impl<A: MappedAddress + LinkLocalAddress> AsRef<A> for NonMappedAddr<LinkLocalAddr<A>>

source§

fn as_ref(&self) -> &A

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

impl<A: MappedAddress + MulticastAddress> AsRef<A> for NonMappedAddr<MulticastAddr<A>>

source§

fn as_ref(&self) -> &A

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

impl<A: MappedAddress + SpecifiedAddress> AsRef<A> for 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: MappedAddress + UnicastAddress> AsRef<A> for NonMappedAddr<UnicastAddr<A>>

source§

fn as_ref(&self) -> &A

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

impl<A: MappedAddress> AsRef<NonMappedAddr<A>> for NonMappedAddr<A>

source§

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

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

impl<A: BroadcastAddress> BroadcastAddress for NonMappedAddr<A>

source§

fn is_broadcast(&self) -> bool

Is this a broadcast address? Read more
source§

impl<A: Clone> Clone for NonMappedAddr<A>

source§

fn clone(&self) -> NonMappedAddr<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> Debug for NonMappedAddr<A>

source§

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

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

impl<A: MappedAddress> Deref for NonMappedAddr<A>

§

type Target = A

The resulting type after dereferencing.
source§

fn deref(&self) -> &A

Dereferences the value.
source§

impl<A: Display> Display for NonMappedAddr<A>

source§

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

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

impl From<IpAddr<NonMappedAddr<Ipv4Addr>, NonMappedAddr<Ipv6Addr>>> for NonMappedAddr<IpAddr>

source§

fn from( addr: IpAddr<NonMappedAddr<Ipv4Addr>, NonMappedAddr<Ipv6Addr>>, ) -> NonMappedAddr<IpAddr>

Converts to this type from the input type.
source§

impl<A: IpAddress> From<NonMappedAddr<A>> for IpAddr<NonMappedAddr<Ipv4Addr>, NonMappedAddr<Ipv6Addr>>

source§

fn from( addr: NonMappedAddr<A>, ) -> IpAddr<NonMappedAddr<Ipv4Addr>, NonMappedAddr<Ipv6Addr>>

Converts to this type from the input type.
source§

impl<A: Into<Ipv4Addr> + MappedAddress + Copy> From<NonMappedAddr<A>> for Ipv4Addr

source§

fn from(addr: NonMappedAddr<A>) -> Ipv4Addr

Converts to this type from the input type.
source§

impl<A: Into<Ipv6Addr> + MappedAddress + Copy> From<NonMappedAddr<A>> for Ipv6Addr

source§

fn from(addr: NonMappedAddr<A>) -> Ipv6Addr

Converts to this type from the input type.
source§

impl<A: IpAddress> From<NonMappedAddr<A>> for NonMappedAddr<IpAddr>

source§

fn from(addr: NonMappedAddr<A>) -> NonMappedAddr<IpAddr>

Converts to this type from the input type.
source§

impl<A: MappedAddress + BroadcastAddress + SpecifiedAddress> From<NonMappedAddr<BroadcastAddr<A>>> for SpecifiedAddr<A>

source§

fn from(addr: NonMappedAddr<BroadcastAddr<A>>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl From<NonMappedAddr<IpAddr>> for IpAddr<NonMappedAddr<Ipv4Addr>, NonMappedAddr<Ipv6Addr>>

source§

fn from( addr: NonMappedAddr<IpAddr>, ) -> IpAddr<NonMappedAddr<Ipv4Addr>, NonMappedAddr<Ipv6Addr>>

Converts to this type from the input type.
source§

impl<A: MappedAddress + LinkLocalAddress + SpecifiedAddress> From<NonMappedAddr<LinkLocalAddr<A>>> for SpecifiedAddr<A>

source§

fn from(addr: NonMappedAddr<LinkLocalAddr<A>>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A: MappedAddress + MulticastAddress + SpecifiedAddress> From<NonMappedAddr<MulticastAddr<A>>> for SpecifiedAddr<A>

source§

fn from(addr: NonMappedAddr<MulticastAddr<A>>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A: MappedAddress + SpecifiedAddress> From<NonMappedAddr<SpecifiedAddr<A>>> for SpecifiedAddr<A>

source§

fn from(addr: NonMappedAddr<SpecifiedAddr<A>>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A: MappedAddress + UnicastAddress + SpecifiedAddress> From<NonMappedAddr<UnicastAddr<A>>> for SpecifiedAddr<A>

source§

fn from(addr: NonMappedAddr<UnicastAddr<A>>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A: Hash> Hash for NonMappedAddr<A>

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<A: LinkLocalAddress> LinkLocalAddress for NonMappedAddr<A>

Is this a link-local address? Read more
source§

impl<A: MulticastAddress> MulticastAddress for NonMappedAddr<A>

source§

fn is_multicast(&self) -> bool

Is this a multicast address? Read more
source§

fn is_non_multicast(&self) -> bool

Is this a non-multicast address? The inverse of is_multicast().
source§

impl<A: Ord> Ord for NonMappedAddr<A>

source§

fn cmp(&self, other: &NonMappedAddr<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 + PartialOrd,

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

impl<A: PartialEq> PartialEq for NonMappedAddr<A>

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<A: PartialOrd> PartialOrd for NonMappedAddr<A>

source§

fn partial_cmp(&self, other: &NonMappedAddr<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

This method 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

This method 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

This method 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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<A: ScopeableAddress> ScopeableAddress for NonMappedAddr<A>

§

type Scope = <A as ScopeableAddress>::Scope

The type of all non-global scopes.
source§

fn scope(&self) -> Self::Scope

The scope of this address. Read more
source§

impl<A: SpecifiedAddress> SpecifiedAddress for NonMappedAddr<A>

source§

fn is_specified(&self) -> bool

Is this a specified address? Read more
source§

impl<A: MappedAddress> TransposableWitness<A> for NonMappedAddr<A>

§

type Map<T> = NonMappedAddr<T>

Maps the type wrapped by this witness.
source§

impl<A: BroadcastAddress + MappedAddress> TryFrom<BroadcastAddr<A>> for NonMappedAddr<A>

§

type Error = ()

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

fn try_from(addr: BroadcastAddr<A>) -> Result<NonMappedAddr<A>, ()>

Performs the conversion.
source§

impl TryFrom<Ipv4Addr> for NonMappedAddr<Ipv4Addr>

§

type Error = ()

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

fn try_from(addr: Ipv4Addr) -> Result<NonMappedAddr<Ipv4Addr>, ()>

Performs the conversion.
source§

impl TryFrom<Ipv6Addr> for NonMappedAddr<Ipv6Addr>

§

type Error = ()

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

fn try_from(addr: Ipv6Addr) -> Result<NonMappedAddr<Ipv6Addr>, ()>

Performs the conversion.
source§

impl<A: LinkLocalAddress + MappedAddress> TryFrom<LinkLocalAddr<A>> for NonMappedAddr<A>

§

type Error = ()

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

fn try_from(addr: LinkLocalAddr<A>) -> Result<NonMappedAddr<A>, ()>

Performs the conversion.
source§

impl<A: MulticastAddress + MappedAddress> TryFrom<MulticastAddr<A>> for NonMappedAddr<A>

§

type Error = ()

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

fn try_from(addr: MulticastAddr<A>) -> Result<NonMappedAddr<A>, ()>

Performs the conversion.
source§

impl<A: MappedAddress + BroadcastAddress> TryFrom<NonMappedAddr<A>> for BroadcastAddr<A>

§

type Error = ()

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

fn try_from(addr: NonMappedAddr<A>) -> Result<BroadcastAddr<A>, ()>

Performs the conversion.
source§

impl<A: MappedAddress + LinkLocalAddress> TryFrom<NonMappedAddr<A>> for LinkLocalAddr<A>

§

type Error = ()

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

fn try_from(addr: NonMappedAddr<A>) -> Result<LinkLocalAddr<A>, ()>

Performs the conversion.
source§

impl<A: MappedAddress + LinkLocalBroadcastAddress> TryFrom<NonMappedAddr<A>> for LinkLocalBroadcastAddr<A>

§

type Error = ()

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

fn try_from(addr: NonMappedAddr<A>) -> Result<LinkLocalBroadcastAddr<A>, ()>

Performs the conversion.
source§

impl<A: MappedAddress + LinkLocalMulticastAddress> TryFrom<NonMappedAddr<A>> for LinkLocalMulticastAddr<A>

§

type Error = ()

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

fn try_from(addr: NonMappedAddr<A>) -> Result<LinkLocalMulticastAddr<A>, ()>

Performs the conversion.
source§

impl<A: MappedAddress + LinkLocalUnicastAddress> TryFrom<NonMappedAddr<A>> for LinkLocalUnicastAddr<A>

§

type Error = ()

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

fn try_from(addr: NonMappedAddr<A>) -> Result<LinkLocalUnicastAddr<A>, ()>

Performs the conversion.
source§

impl<A: MappedAddress + MulticastAddress> TryFrom<NonMappedAddr<A>> for MulticastAddr<A>

§

type Error = ()

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

fn try_from(addr: NonMappedAddr<A>) -> Result<MulticastAddr<A>, ()>

Performs the conversion.
source§

impl<A: MappedAddress + SpecifiedAddress> TryFrom<NonMappedAddr<A>> for SpecifiedAddr<A>

§

type Error = ()

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

fn try_from(addr: NonMappedAddr<A>) -> Result<SpecifiedAddr<A>, ()>

Performs the conversion.
source§

impl<A: MappedAddress + UnicastAddress> TryFrom<NonMappedAddr<A>> for UnicastAddr<A>

§

type Error = ()

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

fn try_from(addr: NonMappedAddr<A>) -> Result<UnicastAddr<A>, ()>

Performs the conversion.
source§

impl<A: SpecifiedAddress + MappedAddress> TryFrom<SpecifiedAddr<A>> for NonMappedAddr<A>

§

type Error = ()

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

fn try_from(addr: SpecifiedAddr<A>) -> Result<NonMappedAddr<A>, ()>

Performs the conversion.
source§

impl<A: UnicastAddress + MappedAddress> TryFrom<UnicastAddr<A>> for NonMappedAddr<A>

§

type Error = ()

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

fn try_from(addr: UnicastAddr<A>) -> Result<NonMappedAddr<A>, ()>

Performs the conversion.
source§

impl<A: UnicastAddress> UnicastAddress for NonMappedAddr<A>

source§

fn is_unicast(&self) -> bool

Is this a unicast address? Read more
source§

impl<A: MappedAddress> Witness<A> for NonMappedAddr<A>

source§

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

Constructs a new witness type. Read more
source§

unsafe fn new_unchecked(addr: A) -> 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: Witness<A>>(addr: W) -> Option<Self>

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

fn transpose<T>(self) -> A::Map<Self::Map<T>>
where Self: TransposableWitness<A>, A: TransposableWitness<T>, Self::Map<T>: Witness<T>, A::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: MappedAddress + BroadcastAddress> Witness<A> for NonMappedAddr<BroadcastAddr<A>>

source§

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

Constructs a new witness type. Read more
source§

unsafe fn new_unchecked(addr: A) -> NonMappedAddr<BroadcastAddr<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: Witness<A>>(addr: W) -> Option<Self>

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

impl<A: MappedAddress + LinkLocalAddress> Witness<A> for NonMappedAddr<LinkLocalAddr<A>>

source§

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

Constructs a new witness type. Read more
source§

unsafe fn new_unchecked(addr: A) -> NonMappedAddr<LinkLocalAddr<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: Witness<A>>(addr: W) -> Option<Self>

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

impl<A: MappedAddress + MulticastAddress> Witness<A> for NonMappedAddr<MulticastAddr<A>>

source§

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

Constructs a new witness type. Read more
source§

unsafe fn new_unchecked(addr: A) -> NonMappedAddr<MulticastAddr<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: Witness<A>>(addr: W) -> Option<Self>

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

impl<A: MappedAddress + SpecifiedAddress> Witness<A> for NonMappedAddr<SpecifiedAddr<A>>

source§

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

Constructs a new witness type. Read more
source§

unsafe fn new_unchecked(addr: A) -> 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: Witness<A>>(addr: W) -> Option<Self>

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

impl<A: MappedAddress + UnicastAddress> Witness<A> for NonMappedAddr<UnicastAddr<A>>

source§

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

Constructs a new witness type. Read more
source§

unsafe fn new_unchecked(addr: A) -> NonMappedAddr<UnicastAddr<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: Witness<A>>(addr: W) -> Option<Self>

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

impl<A: Copy> Copy for NonMappedAddr<A>

source§

impl<A: Eq> Eq for NonMappedAddr<A>

source§

impl<A> StructuralPartialEq for NonMappedAddr<A>

Auto Trait Implementations§

§

impl<A> Freeze for NonMappedAddr<A>
where A: Freeze,

§

impl<A> RefUnwindSafe for NonMappedAddr<A>
where A: RefUnwindSafe,

§

impl<A> Send for NonMappedAddr<A>
where A: Send,

§

impl<A> Sync for NonMappedAddr<A>
where A: Sync,

§

impl<A> Unpin for NonMappedAddr<A>
where A: Unpin,

§

impl<A> UnwindSafe for NonMappedAddr<A>
where A: UnwindSafe,

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§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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<A> LinkLocalBroadcastAddress for A

source§

impl<A> LinkLocalMulticastAddress for A

source§

impl<A> LinkLocalUnicastAddress for A