Enum s2n_quic_core::inet::ip::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
sourceimpl 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
Trait Implementations
sourceimpl Clone for SocketAddress
impl Clone for SocketAddress
sourcefn clone(&self) -> SocketAddress
fn clone(&self) -> SocketAddress
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for SocketAddress
impl Debug for SocketAddress
sourceimpl Default for SocketAddress
impl Default for SocketAddress
sourceimpl Display for SocketAddress
impl Display for SocketAddress
sourceimpl From<(IpAddr, u16)> for SocketAddress
impl From<(IpAddr, u16)> for SocketAddress
sourceimpl From<SocketAddr> for SocketAddress
impl From<SocketAddr> for SocketAddress
sourcefn from(addr: SocketAddr) -> Self
fn from(addr: SocketAddr) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddress> for SocketAddr
impl From<SocketAddress> for SocketAddr
sourcefn from(address: SocketAddress) -> Self
fn from(address: SocketAddress) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddress> for LocalAddress
impl From<SocketAddress> for LocalAddress
sourcefn from(value: SocketAddress) -> Self
fn from(value: SocketAddress) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddress> for RemoteAddress
impl From<SocketAddress> for RemoteAddress
sourcefn from(value: SocketAddress) -> Self
fn from(value: SocketAddress) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddressV4> for SocketAddress
impl From<SocketAddressV4> for SocketAddress
sourcefn from(addr: SocketAddressV4) -> Self
fn from(addr: SocketAddressV4) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddressV6> for SocketAddress
impl From<SocketAddressV6> for SocketAddress
sourcefn from(addr: SocketAddressV6) -> Self
fn from(addr: SocketAddressV6) -> Self
Converts to this type from the input type.
sourceimpl Hash for SocketAddress
impl Hash for SocketAddress
sourceimpl<'a> IntoEvent<SocketAddress<'a>> for &'a SocketAddress
impl<'a> IntoEvent<SocketAddress<'a>> for &'a SocketAddress
fn into_event(self) -> SocketAddress<'a>
sourceimpl<'a> IntoEvent<SocketAddress<'a>> for &'a SocketAddress
impl<'a> IntoEvent<SocketAddress<'a>> for &'a SocketAddress
fn into_event(self) -> SocketAddress<'a>
sourceimpl Ord for SocketAddress
impl Ord for SocketAddress
sourceimpl PartialEq<SocketAddress> for SocketAddress
impl PartialEq<SocketAddress> for SocketAddress
sourcefn 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 ==. Read more
sourcefn ne(&self, other: &SocketAddress) -> bool
fn ne(&self, other: &SocketAddress) -> bool
This method tests for !=.
sourceimpl PartialOrd<SocketAddress> for SocketAddress
impl PartialOrd<SocketAddress> for SocketAddress
sourcefn partial_cmp(&self, other: &SocketAddress) -> Option<Ordering>
fn partial_cmp(&self, other: &SocketAddress) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl ToSocketAddrs for SocketAddress
impl ToSocketAddrs for SocketAddress
type Iter = Once<SocketAddr>
type Iter = Once<SocketAddr>
Returned iterator over socket addresses which this type may correspond to. Read more
sourcefn to_socket_addrs(&self) -> Result<Self::Iter>
fn to_socket_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved SocketAddrs. Read more
sourceimpl Unspecified for SocketAddress
impl Unspecified for SocketAddress
sourcefn is_unspecified(&self) -> bool
fn is_unspecified(&self) -> bool
Returns true if the value is unspecified
sourcefn 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 StructuralEq for SocketAddress
impl StructuralPartialEq for SocketAddress
Auto Trait Implementations
impl RefUnwindSafe for SocketAddress
impl Send for SocketAddress
impl Sync for SocketAddress
impl Unpin for SocketAddress
impl UnwindSafe for SocketAddress
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more