pub struct IpEndpoint {
pub addr: Address,
pub port: u16,
}Expand description
An internet endpoint address.
Endpoint names one peer: both the address and the port are meant to be
specified. UNSPECIFIED is the one exception, a
sentinel for “no endpoint given” where an API defaults it from elsewhere.
UdpSocket::send_with takes the socket’s
connected remote for it.
See also ListenEndpoint, the endpoint of a bind, whose address is
optional so that it can match more than one of our addresses.
Fields§
§addr: Address§port: u16Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub const UNSPECIFIED: Endpoint
pub const UNSPECIFIED: Endpoint
The wildcard endpoint: unspecified address, port zero. Not a destination anything can be sent to, but a sentinel for “no endpoint given”.
Sourcepub const fn new(addr: Address, port: u16) -> Endpoint
pub const fn new(addr: Address, port: u16) -> Endpoint
Create an endpoint address from given address and port.
Sourcepub fn is_specified(&self) -> bool
pub fn is_specified(&self) -> bool
Query whether both the address and the port are specified.
Trait Implementations§
impl Copy for Endpoint
impl Eq for Endpoint
Source§impl From<Endpoint> for SocketAddr
impl From<Endpoint> for SocketAddr
Source§fn from(x: Endpoint) -> SocketAddr
fn from(x: Endpoint) -> SocketAddr
Converts to this type from the input type.
Source§impl From<Endpoint> for ListenEndpoint
impl From<Endpoint> for ListenEndpoint
Source§fn from(endpoint: Endpoint) -> ListenEndpoint
fn from(endpoint: Endpoint) -> ListenEndpoint
Converts to this type from the input type.
Source§impl From<SocketAddr> for Endpoint
Available on crate features ipv4 and ipv6 only.
impl From<SocketAddr> for Endpoint
Available on crate features
ipv4 and ipv6 only.Source§fn from(x: SocketAddr) -> Endpoint
fn from(x: SocketAddr) -> Endpoint
Converts to this type from the input type.
Source§impl Ord for Endpoint
impl Ord for Endpoint
1.21.0 (const: unstable) · 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 PartialOrd for Endpoint
impl PartialOrd for Endpoint
impl StructuralPartialEq for Endpoint
Auto Trait Implementations§
impl Freeze for Endpoint
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
impl UnwindSafe for Endpoint
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