net_types

Struct NonMulticastAddr

Source
pub struct NonMulticastAddr<A>(/* private fields */);
Expand description

An address which is guaranteed to be non-multicast.

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

Implementations§

Source§

impl<A: MulticastAddress> 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: Witness<A>>(addr: W) -> Option<NonMulticastAddr<A>>

Constructs a new NonMulticastAddr from a witness type.

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

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.

Trait Implementations§

Source§

impl<A: MulticastAddress> 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: MulticastAddress + BroadcastAddress> AsRef<A> for NonMulticastAddr<BroadcastAddr<A>>

Source§

fn as_ref(&self) -> &A

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

impl<A: MulticastAddress + MappedAddress> 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: MulticastAddress + MappedAddress + SpecifiedAddress> 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: MulticastAddress + SpecifiedAddress> AsRef<A> for NonMulticastAddr<SpecifiedAddr<A>>

Source§

fn as_ref(&self) -> &A

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

impl<A: MulticastAddress + UnicastAddress> AsRef<A> for NonMulticastAddr<UnicastAddr<A>>

Source§

fn as_ref(&self) -> &A

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

impl<A: MulticastAddress> 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> Clone for NonMulticastAddr<A>

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> Debug for NonMulticastAddr<A>

Source§

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

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

impl<A: MulticastAddress> 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> Display for NonMulticastAddr<A>

Source§

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

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

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

Source§

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

Converts to this type from the input type.
Source§

impl<A: Hash> Hash for NonMulticastAddr<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: Ord> Ord for NonMulticastAddr<A>

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> PartialEq for NonMulticastAddr<A>

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> PartialOrd for NonMulticastAddr<A>

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: MulticastAddress> TransposableWitness<A> for NonMulticastAddr<A>

Source§

type Map<T> = NonMulticastAddr<T>

Maps the type wrapped by this witness.
Source§

impl<A: MulticastAddress> 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: Witness<A>>(addr: W) -> Option<Self>

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::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: MulticastAddress + BroadcastAddress> Witness<A> for NonMulticastAddr<BroadcastAddr<A>>

Source§

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

Constructs a new witness type. Read more
Source§

unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<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§

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

Gets a copy of the address.
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: MulticastAddress + MappedAddress> 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: Witness<A>>(addr: W) -> Option<Self>

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::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: MulticastAddress + MappedAddress + SpecifiedAddress> 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: Witness<A>>(addr: W) -> Option<Self>

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::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: MulticastAddress + SpecifiedAddress> Witness<A> for NonMulticastAddr<SpecifiedAddr<A>>

Source§

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

Constructs a new witness type. Read more
Source§

unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<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§

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

Gets a copy of the address.
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: MulticastAddress + UnicastAddress> Witness<A> for NonMulticastAddr<UnicastAddr<A>>

Source§

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

Constructs a new witness type. Read more
Source§

unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<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§

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

Gets a copy of the address.
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: Copy> Copy for NonMulticastAddr<A>

Source§

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

Source§

impl<A> StructuralPartialEq for NonMulticastAddr<A>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<A> UnwindSafe for NonMulticastAddr<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§

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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> 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>,

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.