Struct netstack3_core::tcp::SocketAddr
source · pub struct SocketAddr<A: IpAddress, D> {
pub ip: ZonedAddr<SpecifiedAddr<A>, D>,
pub port: NonZeroU16,
}
Expand description
Socket address includes the ip address and the port number.
Fields§
§ip: ZonedAddr<SpecifiedAddr<A>, D>
The IP component of the address.
port: NonZeroU16
The port component of the address.
Implementations§
source§impl<A: IpAddress, D> SocketAddr<A, D>
impl<A: IpAddress, D> SocketAddr<A, D>
sourcepub fn map_zone<Y>(self, f: impl FnOnce(D) -> Y) -> SocketAddr<A, Y>
pub fn map_zone<Y>(self, f: impl FnOnce(D) -> Y) -> SocketAddr<A, Y>
Maps the SocketAddr
’s zone type.
Trait Implementations§
source§impl<A: Clone + IpAddress, D: Clone> Clone for SocketAddr<A, D>
impl<A: Clone + IpAddress, D: Clone> Clone for SocketAddr<A, D>
source§fn clone(&self) -> SocketAddr<A, D>
fn clone(&self) -> SocketAddr<A, D>
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<A: IpAddress, D> From<SocketAddr<A, D>> for IpAddr<SocketAddr<Ipv4Addr, D>, SocketAddr<Ipv6Addr, D>>
impl<A: IpAddress, D> From<SocketAddr<A, D>> for IpAddr<SocketAddr<Ipv4Addr, D>, SocketAddr<Ipv6Addr, D>>
source§fn from(
addr: SocketAddr<A, D>
) -> IpAddr<SocketAddr<Ipv4Addr, D>, SocketAddr<Ipv6Addr, D>>
fn from( addr: SocketAddr<A, D> ) -> IpAddr<SocketAddr<Ipv4Addr, D>, SocketAddr<Ipv6Addr, D>>
Converts to this type from the input type.
source§impl<A: IpAddress, D, IpType: Ip> GenericOverIp<IpType> for SocketAddr<A, D>
impl<A: IpAddress, D, IpType: Ip> GenericOverIp<IpType> for SocketAddr<A, D>
§type Type = SocketAddr<<IpType as Ip>::Addr, D>
type Type = SocketAddr<<IpType as Ip>::Addr, D>
The type of
Self
when its IP-generic parameter is replaced with the
type NewIp
.source§impl<A: PartialEq + IpAddress, D: PartialEq> PartialEq for SocketAddr<A, D>
impl<A: PartialEq + IpAddress, D: PartialEq> PartialEq for SocketAddr<A, D>
source§fn eq(&self, other: &SocketAddr<A, D>) -> bool
fn eq(&self, other: &SocketAddr<A, D>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<A: Copy + IpAddress, D: Copy> Copy for SocketAddr<A, D>
impl<A: Eq + IpAddress, D: Eq> Eq for SocketAddr<A, D>
impl<A: IpAddress, D> StructuralPartialEq for SocketAddr<A, D>
Auto Trait Implementations§
impl<A, D> Freeze for SocketAddr<A, D>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + Freeze,
D: Freeze,
impl<A, D> RefUnwindSafe for SocketAddr<A, D>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + RefUnwindSafe,
D: RefUnwindSafe,
impl<A, D> Send for SocketAddr<A, D>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static,
D: Send,
impl<A, D> Sync for SocketAddr<A, D>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static,
D: Sync,
impl<A, D> Unpin for SocketAddr<A, D>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + Unpin,
D: Unpin,
impl<A, D> UnwindSafe for SocketAddr<A, D>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + UnwindSafe,
D: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
Id: HandleableTimer<CC, BC>,
source§fn handle_timer(&mut self, bindings_ctx: &mut BC, id: Id)
fn handle_timer(&mut self, bindings_ctx: &mut BC, id: Id)
Handle a timer firing.