pub struct BroadcastAddr<A>(/* private fields */);
Expand description
An address which is guaranteed to be broadcast.
BroadcastAddr
wraps an address of type A
and guarantees that it is
a broadcast address. Note that this guarantee is contingent on a correct
implementation of the BroadcastAddress
trait. Since that trait is
not unsafe
, unsafe
code may NOT rely on this guarantee for its soundness.
Implementations§
Source§impl<A: BroadcastAddress> BroadcastAddr<A>
impl<A: BroadcastAddress> BroadcastAddr<A>
Sourcepub fn new(addr: A) -> Option<BroadcastAddr<A>>
pub fn new(addr: A) -> Option<BroadcastAddr<A>>
Constructs a new BroadcastAddr
.
new
returns None
if !addr.is_broadcast()
.
Sourcepub fn from_witness<W: Witness<A>>(addr: W) -> Option<BroadcastAddr<A>>
pub fn from_witness<W: Witness<A>>(addr: W) -> Option<BroadcastAddr<A>>
Constructs a new BroadcastAddr
from a
witness type.
from_witness(witness)
is equivalent to new(witness.into_addr())
.
Source§impl<A> BroadcastAddr<A>
impl<A> BroadcastAddr<A>
Sourcepub const unsafe fn new_unchecked(addr: A) -> BroadcastAddr<A>
pub const unsafe fn new_unchecked(addr: A) -> BroadcastAddr<A>
Constructs a new BroadcastAddr
without
checking to see if addr
is actually broadcast.
§Safety
It is up to the caller to make sure that addr
is broadcast to avoid breaking
the guarantees of BroadcastAddr
. See BroadcastAddr
for
more details.
Source§impl<A: BroadcastAddress + SpecifiedAddress> BroadcastAddr<A>
impl<A: BroadcastAddress + SpecifiedAddress> BroadcastAddr<A>
Sourcepub fn into_specified(self) -> SpecifiedAddr<A>
pub fn into_specified(self) -> SpecifiedAddr<A>
Converts this BroadcastAddr
into a
SpecifiedAddr
.
BroadcastAddress::is_broadcast
implies
SpecifiedAddress::is_specified
, so all BroadcastAddr
s are
guaranteed to be specified, so this conversion is infallible.
Trait Implementations§
Source§impl<A: BroadcastAddress> AsRef<A> for BroadcastAddr<A>
impl<A: BroadcastAddress> AsRef<A> for BroadcastAddr<A>
Source§impl<A: BroadcastAddress + LinkLocalAddress> AsRef<A> for BroadcastAddr<LinkLocalAddr<A>>
impl<A: BroadcastAddress + LinkLocalAddress> AsRef<A> for BroadcastAddr<LinkLocalAddr<A>>
Source§impl<A: BroadcastAddress + MappedAddress> AsRef<A> for BroadcastAddr<NonMappedAddr<A>>
impl<A: BroadcastAddress + MappedAddress> AsRef<A> for BroadcastAddr<NonMappedAddr<A>>
Source§impl<A: BroadcastAddress> AsRef<BroadcastAddr<A>> for BroadcastAddr<A>
impl<A: BroadcastAddress> AsRef<BroadcastAddr<A>> for BroadcastAddr<A>
Source§fn as_ref(&self) -> &BroadcastAddr<A>
fn as_ref(&self) -> &BroadcastAddr<A>
Source§impl<A: Clone> Clone for BroadcastAddr<A>
impl<A: Clone> Clone for BroadcastAddr<A>
Source§fn clone(&self) -> BroadcastAddr<A>
fn clone(&self) -> BroadcastAddr<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 BroadcastAddr<A>
impl<A: Debug> Debug for BroadcastAddr<A>
Source§impl<A: BroadcastAddress> Deref for BroadcastAddr<A>
impl<A: BroadcastAddress> Deref for BroadcastAddr<A>
Source§impl<A: Display> Display for BroadcastAddr<A>
impl<A: Display> Display for BroadcastAddr<A>
Source§impl<A: BroadcastAddress + SpecifiedAddress> From<BroadcastAddr<A>> for SpecifiedAddr<A>
impl<A: BroadcastAddress + SpecifiedAddress> From<BroadcastAddr<A>> for SpecifiedAddr<A>
Source§fn from(addr: BroadcastAddr<A>) -> SpecifiedAddr<A>
fn from(addr: BroadcastAddr<A>) -> SpecifiedAddr<A>
Source§impl<A: BroadcastAddress + LinkLocalAddress + SpecifiedAddress> From<BroadcastAddr<LinkLocalAddr<A>>> for SpecifiedAddr<A>
impl<A: BroadcastAddress + LinkLocalAddress + SpecifiedAddress> From<BroadcastAddr<LinkLocalAddr<A>>> for SpecifiedAddr<A>
Source§fn from(addr: BroadcastAddr<LinkLocalAddr<A>>) -> SpecifiedAddr<A>
fn from(addr: BroadcastAddr<LinkLocalAddr<A>>) -> SpecifiedAddr<A>
Source§impl<A: BroadcastAddress + MappedAddress + SpecifiedAddress> From<BroadcastAddr<NonMappedAddr<A>>> for SpecifiedAddr<A>
impl<A: BroadcastAddress + MappedAddress + SpecifiedAddress> From<BroadcastAddr<NonMappedAddr<A>>> for SpecifiedAddr<A>
Source§fn from(addr: BroadcastAddr<NonMappedAddr<A>>) -> SpecifiedAddr<A>
fn from(addr: BroadcastAddr<NonMappedAddr<A>>) -> SpecifiedAddr<A>
Source§impl<A: Hash> Hash for BroadcastAddr<A>
impl<A: Hash> Hash for BroadcastAddr<A>
Source§impl<A: LinkLocalAddress> LinkLocalAddress for BroadcastAddr<A>
impl<A: LinkLocalAddress> LinkLocalAddress for BroadcastAddr<A>
Source§fn is_link_local(&self) -> bool
fn is_link_local(&self) -> bool
Source§impl<A: MappedAddress> MappedAddress for BroadcastAddr<A>
impl<A: MappedAddress> MappedAddress for BroadcastAddr<A>
Source§fn is_non_mapped(&self) -> bool
fn is_non_mapped(&self) -> bool
Source§impl<A: MulticastAddress> MulticastAddress for BroadcastAddr<A>
impl<A: MulticastAddress> MulticastAddress for BroadcastAddr<A>
Source§fn is_multicast(&self) -> bool
fn is_multicast(&self) -> bool
Source§fn is_non_multicast(&self) -> bool
fn is_non_multicast(&self) -> bool
is_multicast()
.Source§impl<A: Ord> Ord for BroadcastAddr<A>
impl<A: Ord> Ord for BroadcastAddr<A>
Source§fn cmp(&self, other: &BroadcastAddr<A>) -> Ordering
fn cmp(&self, other: &BroadcastAddr<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 BroadcastAddr<A>
impl<A: PartialEq> PartialEq for BroadcastAddr<A>
Source§impl<A: PartialOrd> PartialOrd for BroadcastAddr<A>
impl<A: PartialOrd> PartialOrd for BroadcastAddr<A>
Source§impl<A: ScopeableAddress> ScopeableAddress for BroadcastAddr<A>
impl<A: ScopeableAddress> ScopeableAddress for BroadcastAddr<A>
Source§impl<A: SpecifiedAddress> SpecifiedAddress for BroadcastAddr<A>
impl<A: SpecifiedAddress> SpecifiedAddress for BroadcastAddr<A>
Source§fn is_specified(&self) -> bool
fn is_specified(&self) -> bool
Source§impl<A: BroadcastAddress> TransposableWitness<A> for BroadcastAddr<A>
impl<A: BroadcastAddress> TransposableWitness<A> for BroadcastAddr<A>
Source§type Map<T> = BroadcastAddr<T>
type Map<T> = BroadcastAddr<T>
Source§impl<A: BroadcastAddress + LinkLocalAddress> TryFrom<BroadcastAddr<A>> for LinkLocalAddr<A>
impl<A: BroadcastAddress + LinkLocalAddress> TryFrom<BroadcastAddr<A>> for LinkLocalAddr<A>
Source§impl<A: BroadcastAddress + LinkLocalMulticastAddress> TryFrom<BroadcastAddr<A>> for LinkLocalMulticastAddr<A>
impl<A: BroadcastAddress + LinkLocalMulticastAddress> TryFrom<BroadcastAddr<A>> for LinkLocalMulticastAddr<A>
Source§impl<A: BroadcastAddress + LinkLocalUnicastAddress> TryFrom<BroadcastAddr<A>> for LinkLocalUnicastAddr<A>
impl<A: BroadcastAddress + LinkLocalUnicastAddress> TryFrom<BroadcastAddr<A>> for LinkLocalUnicastAddr<A>
Source§impl<A: BroadcastAddress + MulticastAddress> TryFrom<BroadcastAddr<A>> for MulticastAddr<A>
impl<A: BroadcastAddress + MulticastAddress> TryFrom<BroadcastAddr<A>> for MulticastAddr<A>
Source§impl<A: BroadcastAddress + MappedAddress> TryFrom<BroadcastAddr<A>> for NonMappedAddr<A>
impl<A: BroadcastAddress + MappedAddress> TryFrom<BroadcastAddr<A>> for NonMappedAddr<A>
Source§impl<A: BroadcastAddress + UnicastAddress> TryFrom<BroadcastAddr<A>> for UnicastAddr<A>
impl<A: BroadcastAddress + UnicastAddress> TryFrom<BroadcastAddr<A>> for UnicastAddr<A>
Source§impl<A: LinkLocalAddress + BroadcastAddress> TryFrom<LinkLocalAddr<A>> for BroadcastAddr<A>
impl<A: LinkLocalAddress + BroadcastAddress> TryFrom<LinkLocalAddr<A>> for BroadcastAddr<A>
Source§impl<A: MulticastAddress + BroadcastAddress> TryFrom<MulticastAddr<A>> for BroadcastAddr<A>
impl<A: MulticastAddress + BroadcastAddress> TryFrom<MulticastAddr<A>> for BroadcastAddr<A>
Source§impl<A: MappedAddress + BroadcastAddress> TryFrom<NonMappedAddr<A>> for BroadcastAddr<A>
impl<A: MappedAddress + BroadcastAddress> TryFrom<NonMappedAddr<A>> for BroadcastAddr<A>
Source§impl<A: SpecifiedAddress + BroadcastAddress> TryFrom<SpecifiedAddr<A>> for BroadcastAddr<A>
impl<A: SpecifiedAddress + BroadcastAddress> TryFrom<SpecifiedAddr<A>> for BroadcastAddr<A>
Source§impl<A: UnicastAddress + BroadcastAddress> TryFrom<UnicastAddr<A>> for BroadcastAddr<A>
impl<A: UnicastAddress + BroadcastAddress> TryFrom<UnicastAddr<A>> for BroadcastAddr<A>
Source§impl<A: UnicastAddress> UnicastAddress for BroadcastAddr<A>
impl<A: UnicastAddress> UnicastAddress for BroadcastAddr<A>
Source§fn is_unicast(&self) -> bool
fn is_unicast(&self) -> bool
Source§impl<A: BroadcastAddress> Witness<A> for BroadcastAddr<A>
impl<A: BroadcastAddress> Witness<A> for BroadcastAddr<A>
Source§unsafe fn new_unchecked(addr: A) -> BroadcastAddr<A>
unsafe fn new_unchecked(addr: A) -> 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: BroadcastAddress + LinkLocalAddress> Witness<A> for BroadcastAddr<LinkLocalAddr<A>>
impl<A: BroadcastAddress + LinkLocalAddress> Witness<A> for BroadcastAddr<LinkLocalAddr<A>>
Source§fn new(addr: A) -> Option<BroadcastAddr<LinkLocalAddr<A>>>
fn new(addr: A) -> Option<BroadcastAddr<LinkLocalAddr<A>>>
Source§unsafe fn new_unchecked(addr: A) -> BroadcastAddr<LinkLocalAddr<A>>
unsafe fn new_unchecked(addr: A) -> BroadcastAddr<LinkLocalAddr<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: BroadcastAddress + MappedAddress> Witness<A> for BroadcastAddr<NonMappedAddr<A>>
impl<A: BroadcastAddress + MappedAddress> Witness<A> for BroadcastAddr<NonMappedAddr<A>>
Source§fn new(addr: A) -> Option<BroadcastAddr<NonMappedAddr<A>>>
fn new(addr: A) -> Option<BroadcastAddr<NonMappedAddr<A>>>
Source§unsafe fn new_unchecked(addr: A) -> BroadcastAddr<NonMappedAddr<A>>
unsafe fn new_unchecked(addr: A) -> BroadcastAddr<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>>,
impl<A: Copy> Copy for BroadcastAddr<A>
impl<A: Eq> Eq for BroadcastAddr<A>
impl<A> StructuralPartialEq for BroadcastAddr<A>
Auto Trait Implementations§
impl<A> Freeze for BroadcastAddr<A>where
A: Freeze,
impl<A> RefUnwindSafe for BroadcastAddr<A>where
A: RefUnwindSafe,
impl<A> Send for BroadcastAddr<A>where
A: Send,
impl<A> Sync for BroadcastAddr<A>where
A: Sync,
impl<A> Unpin for BroadcastAddr<A>where
A: Unpin,
impl<A> UnwindSafe for BroadcastAddr<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
)