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
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
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
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
sourcefn default() -> SocketAddress
fn default() -> SocketAddress
Returns the “default value” for a type. Read more
sourceimpl Display for SocketAddress
impl Display for SocketAddress
sourceimpl From<SocketAddress> for LocalAddress
impl From<SocketAddress> for LocalAddress
sourcefn from(value: SocketAddress) -> LocalAddress
fn from(value: SocketAddress) -> LocalAddress
Converts to this type from the input type.
sourceimpl From<SocketAddress> for RemoteAddress
impl From<SocketAddress> for RemoteAddress
sourcefn from(value: SocketAddress) -> RemoteAddress
fn from(value: SocketAddress) -> RemoteAddress
Converts to this type from the input type.
sourceimpl From<SocketAddressV4> for SocketAddress
impl From<SocketAddressV4> for SocketAddress
sourcefn from(addr: SocketAddressV4) -> SocketAddress
fn from(addr: SocketAddressV4) -> SocketAddress
Converts to this type from the input type.
sourceimpl From<SocketAddressV6> for SocketAddress
impl From<SocketAddressV6> for SocketAddress
sourcefn from(addr: SocketAddressV6) -> SocketAddress
fn from(addr: SocketAddressV6) -> SocketAddress
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 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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more