pub struct SpecifiedAddr<A>(_);
Expand description

An address which is guaranteed to be specified.

SpecifiedAddr wraps an address of type A and guarantees that it is a specified address. Note that this guarantee is contingent on a correct implementation of the SpecifiedAddress trait. Since that trait is not unsafe, unsafe code may NOT rely on this guarantee for its soundness.

Implementations§

source§

impl<A: SpecifiedAddress> SpecifiedAddr<A>

source

pub fn new(addr: A) -> Option<SpecifiedAddr<A>>

Constructs a new SpecifiedAddr.

new returns None if !addr.is_specified().

source

pub fn from_witness<W: Witness<A>>(addr: W) -> Option<SpecifiedAddr<A>>

Constructs a new SpecifiedAddr from a witness type.

from_witness(witness) is equivalent to new(witness.into_addr()).

source§

impl<A> SpecifiedAddr<A>

source

pub const unsafe fn new_unchecked(addr: A) -> SpecifiedAddr<A>

Constructs a new SpecifiedAddr without checking to see if addr is actually specified.

Safety

It is up to the caller to make sure that addr is specified to avoid breaking the guarantees of SpecifiedAddr. See SpecifiedAddr for more details.

Trait Implementations§

source§

impl<A: SpecifiedAddress> AsRef<A> for SpecifiedAddr<A>

source§

fn as_ref(&self) -> &A

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<A: BroadcastAddress> BroadcastAddress for SpecifiedAddr<A>

source§

fn is_broadcast(&self) -> bool

Is this a broadcast address? Read more
source§

impl<A: Clone> Clone for SpecifiedAddr<A>

source§

fn clone(&self) -> SpecifiedAddr<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 SpecifiedAddr<A>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<A: SpecifiedAddress> Deref for SpecifiedAddr<A>

§

type Target = A

The resulting type after dereferencing.
source§

fn deref(&self) -> &A

Dereferences the value.
source§

impl<A: SpecifiedAddress + Display> Display for SpecifiedAddr<A>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<A: BroadcastAddress + SpecifiedAddress> From<BroadcastAddr<A>> for SpecifiedAddr<A>

source§

fn from(addr: BroadcastAddr<A>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A: BroadcastAddress + LinkLocalAddress + SpecifiedAddress> From<BroadcastAddr<LinkLocalAddr<A>>> for SpecifiedAddr<A>

source§

fn from(addr: BroadcastAddr<LinkLocalAddr<A>>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl From<IpAddr<SpecifiedAddr<Ipv4Addr>, SpecifiedAddr<Ipv6Addr>>> for SpecifiedAddr<IpAddr>

source§

fn from( addr: IpAddr<SpecifiedAddr<Ipv4Addr>, SpecifiedAddr<Ipv6Addr>> ) -> SpecifiedAddr<IpAddr>

Converts to this type from the input type.
source§

impl<A: LinkLocalAddress + SpecifiedAddress> From<LinkLocalAddr<A>> for SpecifiedAddr<A>

source§

fn from(addr: LinkLocalAddr<A>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A: LinkLocalAddress + BroadcastAddress + SpecifiedAddress> From<LinkLocalAddr<BroadcastAddr<A>>> for SpecifiedAddr<A>

source§

fn from(addr: LinkLocalAddr<BroadcastAddr<A>>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A: LinkLocalAddress + MulticastAddress + SpecifiedAddress> From<LinkLocalAddr<MulticastAddr<A>>> for SpecifiedAddr<A>

source§

fn from(addr: LinkLocalAddr<MulticastAddr<A>>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A: LinkLocalAddress + UnicastAddress + SpecifiedAddress> From<LinkLocalAddr<UnicastAddr<A>>> for SpecifiedAddr<A>

source§

fn from(addr: LinkLocalAddr<UnicastAddr<A>>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A: MulticastAddress + SpecifiedAddress> From<MulticastAddr<A>> for SpecifiedAddr<A>

source§

fn from(addr: MulticastAddr<A>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A: MulticastAddress + LinkLocalAddress + SpecifiedAddress> From<MulticastAddr<LinkLocalAddr<A>>> for SpecifiedAddr<A>

source§

fn from(addr: MulticastAddr<LinkLocalAddr<A>>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A: IpAddress> From<SpecifiedAddr<A>> for IpAddr<SpecifiedAddr<Ipv4Addr>, SpecifiedAddr<Ipv6Addr>>

source§

fn from( addr: SpecifiedAddr<A> ) -> IpAddr<SpecifiedAddr<Ipv4Addr>, SpecifiedAddr<Ipv6Addr>>

Converts to this type from the input type.
source§

impl<A: IpAddress> From<SpecifiedAddr<A>> for SpecifiedAddr<IpAddr>

source§

fn from(addr: SpecifiedAddr<A>) -> SpecifiedAddr<IpAddr>

Converts to this type from the input type.
source§

impl<A, Z> From<SpecifiedAddr<A>> for ZonedAddr<A, Z>

source§

fn from(a: SpecifiedAddr<A>) -> Self

Converts to this type from the input type.
source§

impl From<SpecifiedAddr<IpAddr<Ipv4Addr, Ipv6Addr>>> for IpAddr<SpecifiedAddr<Ipv4Addr>, SpecifiedAddr<Ipv6Addr>>

source§

fn from( addr: SpecifiedAddr<IpAddr> ) -> IpAddr<SpecifiedAddr<Ipv4Addr>, SpecifiedAddr<Ipv6Addr>>

Converts to this type from the input type.
source§

impl From<SpecifiedAddr<Ipv4Addr>> for Ipv4Addr

source§

fn from(addr: SpecifiedAddr<Ipv4Addr>) -> Ipv4Addr

Converts to this type from the input type.
source§

impl From<SpecifiedAddr<Ipv6Addr>> for Ipv6Addr

source§

fn from(addr: SpecifiedAddr<Ipv6Addr>) -> Ipv6Addr

Converts to this type from the input type.
source§

impl<A: UnicastAddress + SpecifiedAddress> From<UnicastAddr<A>> for SpecifiedAddr<A>

source§

fn from(addr: UnicastAddr<A>) -> SpecifiedAddr<A>

Converts to this type from the input type.
source§

impl<A, I: Ip> GenericOverIp<I> for SpecifiedAddr<A>

§

type Type = SpecifiedAddr<<I as Ip>::Addr>

The type of Self when its IP-generic parameter is replaced with the type NewIp.
source§

impl<A: Hash> Hash for SpecifiedAddr<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 IpAddrWitness for SpecifiedAddr<IpAddr>

§

type V4 = SpecifiedAddr<Ipv4Addr>

The IPv4-specific version of Self. Read more
§

type V6 = SpecifiedAddr<Ipv6Addr>

The IPv6-specific version of Self. Read more
source§

fn from_v4(addr: Self::V4) -> Self

Converts an IPv4-specific witness into a general witness.
source§

fn from_v6(addr: Self::V6) -> Self

Converts an IPv6-specific witness into a general witness.
source§

impl<A: IpAddress> IpAddressWitness<A> for SpecifiedAddr<A>

§

type IpAddrWitness = SpecifiedAddr<IpAddr<Ipv4Addr, Ipv6Addr>>

The type-erased version of Self. Read more
source§

impl<A: LinkLocalAddress> LinkLocalAddress for SpecifiedAddr<A>

Is this a link-local address? Read more
source§

impl<A: MulticastAddress> MulticastAddress for SpecifiedAddr<A>

source§

fn is_multicast(&self) -> bool

Is this a unicast address? Read more
source§

impl<A: PartialEq> PartialEq<SpecifiedAddr<A>> for SpecifiedAddr<A>

source§

fn eq(&self, other: &SpecifiedAddr<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 TryFrom<Ipv4Addr> for SpecifiedAddr<Ipv4Addr>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(addr: Ipv4Addr) -> Result<SpecifiedAddr<Ipv4Addr>, ()>

Performs the conversion.
source§

impl TryFrom<Ipv6Addr> for SpecifiedAddr<Ipv6Addr>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(addr: Ipv6Addr) -> Result<SpecifiedAddr<Ipv6Addr>, ()>

Performs the conversion.
source§

impl<A: SpecifiedAddress + BroadcastAddress> TryFrom<SpecifiedAddr<A>> for BroadcastAddr<A>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(addr: SpecifiedAddr<A>) -> Result<BroadcastAddr<A>, ()>

Performs the conversion.
source§

impl<A: SpecifiedAddress + LinkLocalAddress> TryFrom<SpecifiedAddr<A>> for LinkLocalAddr<A>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(addr: SpecifiedAddr<A>) -> Result<LinkLocalAddr<A>, ()>

Performs the conversion.
source§

impl<A: SpecifiedAddress + LinkLocalBroadcastAddress> TryFrom<SpecifiedAddr<A>> for LinkLocalBroadcastAddr<A>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(addr: SpecifiedAddr<A>) -> Result<LinkLocalBroadcastAddr<A>, ()>

Performs the conversion.
source§

impl<A: SpecifiedAddress + LinkLocalMulticastAddress> TryFrom<SpecifiedAddr<A>> for LinkLocalMulticastAddr<A>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(addr: SpecifiedAddr<A>) -> Result<LinkLocalMulticastAddr<A>, ()>

Performs the conversion.
source§

impl<A: SpecifiedAddress + LinkLocalUnicastAddress> TryFrom<SpecifiedAddr<A>> for LinkLocalUnicastAddr<A>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(addr: SpecifiedAddr<A>) -> Result<LinkLocalUnicastAddr<A>, ()>

Performs the conversion.
source§

impl<A: SpecifiedAddress + MulticastAddress> TryFrom<SpecifiedAddr<A>> for MulticastAddr<A>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(addr: SpecifiedAddr<A>) -> Result<MulticastAddr<A>, ()>

Performs the conversion.
source§

impl<A: SpecifiedAddress + UnicastAddress> TryFrom<SpecifiedAddr<A>> for UnicastAddr<A>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(addr: SpecifiedAddr<A>) -> Result<UnicastAddr<A>, ()>

Performs the conversion.
source§

impl<A: UnicastAddress> UnicastAddress for SpecifiedAddr<A>

source§

fn is_unicast(&self) -> bool

Is this a unicast address? Read more
source§

impl<A: SpecifiedAddress> Witness<A> for SpecifiedAddr<A>

source§

fn new(addr: A) -> Option<SpecifiedAddr<A>>

Constructs a new witness type. Read more
source§

unsafe fn new_unchecked(addr: A) -> 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: Copy> Copy for SpecifiedAddr<A>

source§

impl<A: Eq> Eq for SpecifiedAddr<A>

source§

impl<A> StructuralEq for SpecifiedAddr<A>

source§

impl<A> StructuralPartialEq for SpecifiedAddr<A>

Auto Trait Implementations§

§

impl<A> RefUnwindSafe for SpecifiedAddr<A>where A: RefUnwindSafe,

§

impl<A> Send for SpecifiedAddr<A>where A: Send,

§

impl<A> Sync for SpecifiedAddr<A>where A: Sync,

§

impl<A> Unpin for SpecifiedAddr<A>where A: Unpin,

§

impl<A> UnwindSafe for SpecifiedAddr<A>where A: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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.
source§

impl<A> LinkLocalBroadcastAddress for Awhere A: LinkLocalAddress + BroadcastAddress,

source§

impl<A> LinkLocalMulticastAddress for Awhere A: LinkLocalAddress + MulticastAddress,

source§

impl<A> LinkLocalUnicastAddress for Awhere A: LinkLocalAddress + UnicastAddress,