Enum s2n_quic_transport::connection::close::SocketAddress
source · pub enum SocketAddress {
IpV4(SocketAddressV4),
IpV6(SocketAddressV6),
}
Expand description
An IP socket address, either IPv4 or IPv6, with a specific port.
Instead of using std::net::SocketAddr
, this implementation
is geared towards no_std
environments and zerocopy decoding.
The size is also consistent across target operating systems.
Variants§
IpV4(SocketAddressV4)
IpV6(SocketAddressV6)
Implementations§
source§impl SocketAddress
impl SocketAddress
pub fn ip(&self) -> IpAddress
pub fn port(&self) -> u16
pub fn set_port(&mut self, port: u16)
pub const fn unicast_scope(&self) -> Option<UnicastScope>
sourcepub fn to_ipv6_mapped(self) -> SocketAddressV6
pub fn to_ipv6_mapped(self) -> SocketAddressV6
Converts the IP address into a IPv6 mapped address
sourcepub fn unmap(self) -> SocketAddress
pub fn unmap(self) -> SocketAddress
Converts the IP address into IPv4 if it is mapped, otherwise the address is unchanged
Trait Implementations§
source§impl Clone for SocketAddress
impl Clone for SocketAddress
source§fn clone(&self) -> SocketAddress
fn clone(&self) -> SocketAddress
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SocketAddress
impl Debug for SocketAddress
source§impl Default for SocketAddress
impl Default for SocketAddress
source§fn default() -> SocketAddress
fn default() -> SocketAddress
Returns the “default value” for a type. Read more
source§impl Display for SocketAddress
impl Display for SocketAddress
source§impl From<SocketAddress> for LocalAddress
impl From<SocketAddress> for LocalAddress
source§fn from(value: SocketAddress) -> LocalAddress
fn from(value: SocketAddress) -> LocalAddress
Converts to this type from the input type.
source§impl From<SocketAddress> for RemoteAddress
impl From<SocketAddress> for RemoteAddress
source§fn from(value: SocketAddress) -> RemoteAddress
fn from(value: SocketAddress) -> RemoteAddress
Converts to this type from the input type.
source§impl From<SocketAddressV4> for SocketAddress
impl From<SocketAddressV4> for SocketAddress
source§fn from(addr: SocketAddressV4) -> SocketAddress
fn from(addr: SocketAddressV4) -> SocketAddress
Converts to this type from the input type.
source§impl From<SocketAddressV6> for SocketAddress
impl From<SocketAddressV6> for SocketAddress
source§fn from(addr: SocketAddressV6) -> SocketAddress
fn from(addr: SocketAddressV6) -> SocketAddress
Converts to this type from the input type.
source§impl Hash for SocketAddress
impl Hash for SocketAddress
source§impl<'a> IntoEvent<SocketAddress<'a>> for &'a SocketAddress
impl<'a> IntoEvent<SocketAddress<'a>> for &'a SocketAddress
fn into_event(self) -> SocketAddress<'a>
source§impl<'a> IntoEvent<SocketAddress<'a>> for &'a SocketAddress
impl<'a> IntoEvent<SocketAddress<'a>> for &'a SocketAddress
fn into_event(self) -> SocketAddress<'a>
source§impl Ord for SocketAddress
impl Ord for SocketAddress
source§fn cmp(&self, other: &SocketAddress) -> Ordering
fn cmp(&self, other: &SocketAddress) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for SocketAddress
impl PartialEq for SocketAddress
source§fn eq(&self, other: &SocketAddress) -> bool
fn eq(&self, other: &SocketAddress) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for SocketAddress
impl PartialOrd for SocketAddress
source§fn partial_cmp(&self, other: &SocketAddress) -> Option<Ordering>
fn partial_cmp(&self, other: &SocketAddress) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Unspecified for SocketAddress
impl Unspecified for SocketAddress
source§fn is_unspecified(&self) -> bool
fn is_unspecified(&self) -> bool
Returns true if the value is unspecified
source§fn filter_unspecified(self) -> Option<Self>
fn filter_unspecified(self) -> Option<Self>
Coerce a potentially unspecified value into an Option
impl Copy for SocketAddress
impl Eq for SocketAddress
impl StructuralPartialEq for SocketAddress
Auto Trait Implementations§
impl Freeze for SocketAddress
impl RefUnwindSafe for SocketAddress
impl Send for SocketAddress
impl Sync for SocketAddress
impl Unpin for SocketAddress
impl UnwindSafe for SocketAddress
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