Type Alias RoutableIpAddr

Source
pub type RoutableIpAddr<A> = SocketIpAddr<A>;
Expand description

An IP Address that witnesses properties needed to be routed.

Aliased Type§

struct RoutableIpAddr<A>(/* private fields */);

Implementations

Source§

impl<A> SocketIpAddr<A>
where A: IpAddress,

Source

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

Constructs a SocketIpAddr if the address is compliant, else None.

Source

pub fn new_from_witness( addr: NonMappedAddr<SpecifiedAddr<A>>, ) -> SocketIpAddr<A>

Constructs a SocketIpAddr from the inner witness.

Source

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

Constructs a SocketIpAddr without verify the address’s properties.

§Safety

Callers must ensure that the addr is both a SpecifiedAddr and a NonMappedAddr.

Source

pub const unsafe fn new_from_specified_unchecked( addr: SpecifiedAddr<A>, ) -> SocketIpAddr<A>

Like SocketIpAddr::new_unchecked, but the address is specified.

§Safety

Callers must ensure that the addr is a NonMappedAddr.

Source

pub fn addr(self) -> A

Returns the inner address, dropping all witnesses.

Source

pub fn into_inner(self) -> NonMappedAddr<SpecifiedAddr<A>>

Returns the inner address, including all witness types.

Source

pub fn new_from_multicast(addr: MulticastAddr<A>) -> SocketIpAddr<A>

Constructs a SocketIpAddr from the given multicast address.

Source§

impl SocketIpAddr<Ipv4Addr>

Source

pub fn new_ipv4_specified( addr: SpecifiedAddr<Ipv4Addr>, ) -> SocketIpAddr<Ipv4Addr>

Constructs a SocketIpAddr from a given specified IPv4 address.

Source§

impl SocketIpAddr<Ipv6Addr>

Source

pub fn new_from_ipv6_non_mapped_unicast( addr: NonMappedAddr<UnicastAddr<Ipv6Addr>>, ) -> SocketIpAddr<Ipv6Addr>

Constructs a SocketIpAddr from the given [Ipv6DeviceAddr].

Source

pub fn new_from_ipv6_source( addr: Ipv6SourceAddr, ) -> Option<SocketIpAddr<Ipv6Addr>>

Optionally constructs a SocketIpAddr from the given Ipv6SourceAddr, returning None if the given addr is Unspecified.

Trait Implementations

Source§

impl<A> AsRef<SpecifiedAddr<A>> for SocketIpAddr<A>
where A: IpAddress,

Source§

fn as_ref(&self) -> &SpecifiedAddr<A>

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

impl<A> Clone for SocketIpAddr<A>
where A: Clone + IpAddress,

Source§

fn clone(&self) -> SocketIpAddr<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 for SocketIpAddr<A>
where A: IpAddress,

Source§

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

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

impl<A> Display for SocketIpAddr<A>
where A: IpAddress,

Source§

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

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

impl<A> From<IpDeviceAddr<A>> for SocketIpAddr<A>
where A: IpAddress,

Source§

fn from(addr: IpDeviceAddr<A>) -> SocketIpAddr<A>

Converts to this type from the input type.
Source§

impl<A, IpType> GenericOverIp<IpType> for SocketIpAddr<A>
where A: IpAddress, IpType: Ip, <IpType as Ip>::Addr: IpAddress,

Source§

type Type = SocketIpAddr<<IpType as Ip>::Addr>

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

impl<A> Hash for SocketIpAddr<A>
where A: Hash + IpAddress,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

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<A> PartialEq for SocketIpAddr<A>
where A: PartialEq + IpAddress,

Source§

fn eq(&self, other: &SocketIpAddr<A>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<A> ScopeableAddress for SocketIpAddr<A>
where A: IpAddress,

Allows SocketIpAddr to be used inside of a ZonedAddr.

Source§

type Scope = <A as ScopeableAddress>::Scope

The type of all non-global scopes.
Source§

fn scope(&self) -> <SocketIpAddr<A> as ScopeableAddress>::Scope

The scope of this address. Read more
Source§

impl<A> TryFrom<SpecifiedAddr<A>> for SocketIpAddr<A>
where A: IpAddress,

Source§

type Error = AddrIsMappedError

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

fn try_from( addr: SpecifiedAddr<A>, ) -> Result<SocketIpAddr<A>, <SocketIpAddr<A> as TryFrom<SpecifiedAddr<A>>>::Error>

Performs the conversion.
Source§

impl<A> Copy for SocketIpAddr<A>
where A: Copy + IpAddress,

Source§

impl<A> Eq for SocketIpAddr<A>
where A: Eq + IpAddress,

Source§

impl<A> StructuralPartialEq for SocketIpAddr<A>
where A: IpAddress,