Struct net_types::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>

§

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

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

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

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

§

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

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§

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§

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§

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§

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§

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.