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§impl<A: PartialOrd> PartialOrd for NonMulticastAddr<A>
impl<A: PartialOrd> PartialOrd for NonMulticastAddr<A>
Source§impl<A: MulticastAddress> TransposableWitness<A> for NonMulticastAddr<A>
impl<A: MulticastAddress> TransposableWitness<A> for NonMulticastAddr<A>
Source§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§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 + 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§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 + 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§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 + 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§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 + 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 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>>,
impl<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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)