pub enum ZonedAddr<A, Z> {
Unzoned(A),
Zoned(AddrAndZone<A, Z>),
}
Expand description
An address that may have an associated scope zone.
Variants§
Unzoned(A)
Zoned(AddrAndZone<A, Z>)
Implementations§
source§impl<A: ScopeableAddress, Z> ZonedAddr<A, Z>
impl<A: ScopeableAddress, Z> ZonedAddr<A, Z>
sourcepub fn new(addr: A, zone: Option<Z>) -> Option<Self>
pub fn new(addr: A, zone: Option<Z>) -> Option<Self>
Creates a new ZonedAddr
with the provided optional scope zone.
If zone
is None
, ZonedAddr::Unzoned
is returned. Otherwise, a
ZonedAddr::Zoned
is returned only if the provided addr
’s scope can
have a zone (addr.scope().can_have_zone()
).
sourcepub fn into_addr_zone(self) -> (A, Option<Z>)
pub fn into_addr_zone(self) -> (A, Option<Z>)
Decomposes this ZonedAddr
into an addr and an optional scope zone.
Trait Implementations§
source§impl<A, Z> From<AddrAndZone<A, Z>> for ZonedAddr<A, Z>
impl<A, Z> From<AddrAndZone<A, Z>> for ZonedAddr<A, Z>
source§fn from(a: AddrAndZone<A, Z>) -> Self
fn from(a: AddrAndZone<A, Z>) -> Self
Converts to this type from the input type.
source§impl<A: GenericOverIp<I>, I: Ip, Z> GenericOverIp<I> for ZonedAddr<A, Z>
impl<A: GenericOverIp<I>, I: Ip, Z> GenericOverIp<I> for ZonedAddr<A, Z>
§type Type = ZonedAddr<<A as GenericOverIp<I>>::Type, Z>
type Type = ZonedAddr<<A as GenericOverIp<I>>::Type, Z>
The type of
Self
when its IP-generic parameter is replaced with the
type NewIp
.source§impl<A: PartialEq, Z: PartialEq> PartialEq<ZonedAddr<A, Z>> for ZonedAddr<A, Z>
impl<A: PartialEq, Z: PartialEq> PartialEq<ZonedAddr<A, Z>> for ZonedAddr<A, Z>
impl<A: Copy, Z: Copy> Copy for ZonedAddr<A, Z>
impl<A: Eq, Z: Eq> Eq for ZonedAddr<A, Z>
impl<A, Z> StructuralEq for ZonedAddr<A, Z>
impl<A, Z> StructuralPartialEq for ZonedAddr<A, Z>
Auto Trait Implementations§
impl<A, Z> RefUnwindSafe for ZonedAddr<A, Z>where A: RefUnwindSafe, Z: RefUnwindSafe,
impl<A, Z> Send for ZonedAddr<A, Z>where A: Send, Z: Send,
impl<A, Z> Sync for ZonedAddr<A, Z>where A: Sync, Z: Sync,
impl<A, Z> Unpin for ZonedAddr<A, Z>where A: Unpin, Z: Unpin,
impl<A, Z> UnwindSafe for ZonedAddr<A, Z>where A: UnwindSafe, Z: 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
Mutably borrows from an owned value. Read more