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>
impl<A: MulticastAddress> NonMulticastAddr<A>
sourcepub fn new(addr: A) -> Option<NonMulticastAddr<A>>
pub fn new(addr: A) -> Option<NonMulticastAddr<A>>
Constructs a new NonMulticastAddr
.
new
returns None
if !addr.is_non_multicast()
.
sourcepub fn from_witness<W: Witness<A>>(addr: W) -> Option<NonMulticastAddr<A>>
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>
impl<A> NonMulticastAddr<A>
sourcepub const unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<A>
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>
impl<A: MulticastAddress> AsRef<A> for NonMulticastAddr<A>
source§impl<A: MulticastAddress + BroadcastAddress> AsRef<A> for NonMulticastAddr<BroadcastAddr<A>>
impl<A: MulticastAddress + BroadcastAddress> AsRef<A> for NonMulticastAddr<BroadcastAddr<A>>
source§impl<A: MulticastAddress + MappedAddress> AsRef<A> for NonMulticastAddr<NonMappedAddr<A>>
impl<A: MulticastAddress + MappedAddress> AsRef<A> for NonMulticastAddr<NonMappedAddr<A>>
source§impl<A: MulticastAddress + MappedAddress + SpecifiedAddress> AsRef<A> for NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>
impl<A: MulticastAddress + MappedAddress + SpecifiedAddress> AsRef<A> for NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>
source§impl<A: MulticastAddress + SpecifiedAddress> AsRef<A> for NonMulticastAddr<SpecifiedAddr<A>>
impl<A: MulticastAddress + SpecifiedAddress> AsRef<A> for NonMulticastAddr<SpecifiedAddr<A>>
source§impl<A: MulticastAddress + UnicastAddress> AsRef<A> for NonMulticastAddr<UnicastAddr<A>>
impl<A: MulticastAddress + UnicastAddress> AsRef<A> for NonMulticastAddr<UnicastAddr<A>>
source§impl<A: MulticastAddress> AsRef<NonMulticastAddr<A>> for NonMulticastAddr<A>
impl<A: MulticastAddress> AsRef<NonMulticastAddr<A>> for NonMulticastAddr<A>
source§fn as_ref(&self) -> &NonMulticastAddr<A>
fn as_ref(&self) -> &NonMulticastAddr<A>
source§impl<A: Clone> Clone for NonMulticastAddr<A>
impl<A: Clone> Clone for NonMulticastAddr<A>
source§fn clone(&self) -> NonMulticastAddr<A>
fn clone(&self) -> NonMulticastAddr<A>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<A: Debug> Debug for NonMulticastAddr<A>
impl<A: Debug> Debug for NonMulticastAddr<A>
source§impl<A: MulticastAddress> Deref for NonMulticastAddr<A>
impl<A: MulticastAddress> Deref for NonMulticastAddr<A>
source§impl<A: Display> Display for NonMulticastAddr<A>
impl<A: Display> Display for NonMulticastAddr<A>
source§impl<A: MulticastAddress + MappedAddress + SpecifiedAddress> From<NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>> for SpecifiedAddr<A>
impl<A: MulticastAddress + MappedAddress + SpecifiedAddress> From<NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>> for SpecifiedAddr<A>
source§fn from(
addr: NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>,
) -> SpecifiedAddr<A>
fn from( addr: NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>, ) -> SpecifiedAddr<A>
source§impl<A: Hash> Hash for NonMulticastAddr<A>
impl<A: Hash> Hash for NonMulticastAddr<A>
source§impl<A: Ord> Ord for NonMulticastAddr<A>
impl<A: Ord> Ord for NonMulticastAddr<A>
source§fn cmp(&self, other: &NonMulticastAddr<A>) -> Ordering
fn cmp(&self, other: &NonMulticastAddr<A>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<A: PartialEq> PartialEq for NonMulticastAddr<A>
impl<A: PartialEq> PartialEq for NonMulticastAddr<A>
source§fn eq(&self, other: &NonMulticastAddr<A>) -> bool
fn eq(&self, other: &NonMulticastAddr<A>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<A: PartialOrd> PartialOrd for NonMulticastAddr<A>
impl<A: PartialOrd> PartialOrd for NonMulticastAddr<A>
source§fn partial_cmp(&self, other: &NonMulticastAddr<A>) -> Option<Ordering>
fn partial_cmp(&self, other: &NonMulticastAddr<A>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<A: MulticastAddress> TransposableWitness<A> for NonMulticastAddr<A>
impl<A: MulticastAddress> TransposableWitness<A> for NonMulticastAddr<A>
§type Map<T> = NonMulticastAddr<T>
type Map<T> = NonMulticastAddr<T>
source§impl<A: MulticastAddress> Witness<A> for NonMulticastAddr<A>
impl<A: MulticastAddress> Witness<A> for NonMulticastAddr<A>
source§unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<A>
unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<A>
addr
actually
satisfies the required property. Read moresource§fn from_witness<W: Witness<A>>(addr: W) -> Option<Self>
fn from_witness<W: Witness<A>>(addr: W) -> Option<Self>
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>>,
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>>,
source§impl<A: MulticastAddress + BroadcastAddress> Witness<A> for NonMulticastAddr<BroadcastAddr<A>>
impl<A: MulticastAddress + BroadcastAddress> Witness<A> for NonMulticastAddr<BroadcastAddr<A>>
source§fn new(addr: A) -> Option<NonMulticastAddr<BroadcastAddr<A>>>
fn new(addr: A) -> Option<NonMulticastAddr<BroadcastAddr<A>>>
source§unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<BroadcastAddr<A>>
unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<BroadcastAddr<A>>
addr
actually
satisfies the required property. Read moresource§impl<A: MulticastAddress + MappedAddress> Witness<A> for NonMulticastAddr<NonMappedAddr<A>>
impl<A: MulticastAddress + MappedAddress> Witness<A> for NonMulticastAddr<NonMappedAddr<A>>
source§fn new(addr: A) -> Option<NonMulticastAddr<NonMappedAddr<A>>>
fn new(addr: A) -> Option<NonMulticastAddr<NonMappedAddr<A>>>
source§unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<NonMappedAddr<A>>
unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<NonMappedAddr<A>>
addr
actually
satisfies the required property. Read moresource§impl<A: MulticastAddress + MappedAddress + SpecifiedAddress> Witness<A> for NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>
impl<A: MulticastAddress + MappedAddress + SpecifiedAddress> Witness<A> for NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>
source§fn new(addr: A) -> Option<NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>>
fn new(addr: A) -> Option<NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>>
source§unsafe fn new_unchecked(
addr: A,
) -> NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>
unsafe fn new_unchecked( addr: A, ) -> NonMulticastAddr<NonMappedAddr<SpecifiedAddr<A>>>
addr
actually
satisfies the required property. Read moresource§impl<A: MulticastAddress + SpecifiedAddress> Witness<A> for NonMulticastAddr<SpecifiedAddr<A>>
impl<A: MulticastAddress + SpecifiedAddress> Witness<A> for NonMulticastAddr<SpecifiedAddr<A>>
source§fn new(addr: A) -> Option<NonMulticastAddr<SpecifiedAddr<A>>>
fn new(addr: A) -> Option<NonMulticastAddr<SpecifiedAddr<A>>>
source§unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<SpecifiedAddr<A>>
unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<SpecifiedAddr<A>>
addr
actually
satisfies the required property. Read moresource§impl<A: MulticastAddress + UnicastAddress> Witness<A> for NonMulticastAddr<UnicastAddr<A>>
impl<A: MulticastAddress + UnicastAddress> Witness<A> for NonMulticastAddr<UnicastAddr<A>>
source§fn new(addr: A) -> Option<NonMulticastAddr<UnicastAddr<A>>>
fn new(addr: A) -> Option<NonMulticastAddr<UnicastAddr<A>>>
source§unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<UnicastAddr<A>>
unsafe fn new_unchecked(addr: A) -> NonMulticastAddr<UnicastAddr<A>>
addr
actually
satisfies the required property. Read moreimpl<A: Copy> Copy for NonMulticastAddr<A>
impl<A: Eq> Eq for NonMulticastAddr<A>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)