pub struct IpEndpoint<P> { /* private fields */ }
Expand description
The endpoint of internet protocol.
Implementations§
Source§impl<P: Protocol> IpEndpoint<P>
impl<P: Protocol> IpEndpoint<P>
Sourcepub fn new<T>(addr: T, port: u16) -> Selfwhere
T: IntoEndpoint<P>,
pub fn new<T>(addr: T, port: u16) -> Selfwhere
T: IntoEndpoint<P>,
Returns a IpEndpoint from IP address and port number.
§Examples
use asyncio::ip::{IpEndpoint, IpAddrV4, Tcp};
let ep: IpEndpoint<Tcp> = IpEndpoint::new(IpAddrV4::loopback(), 80);
Sourcepub fn is_v4(&self) -> bool
pub fn is_v4(&self) -> bool
Returns true if this is IpEndpoint of IP-v4 address.
§Examples
use asyncio::ip::{IpEndpoint, IpAddrV4, IpAddrV6, Tcp};
let ep: IpEndpoint<Tcp> = IpEndpoint::new(IpAddrV4::loopback(), 80);
assert_eq!(ep.is_v4(), true);
let ep: IpEndpoint<Tcp> = IpEndpoint::new(IpAddrV6::loopback(), 80);
assert_eq!(ep.is_v4(), false);
Sourcepub fn is_v6(&self) -> bool
pub fn is_v6(&self) -> bool
Returns true if this is IpEndpoint of IP-v6 address.
§Examples
use asyncio::ip::{IpEndpoint, IpAddrV4, IpAddrV6, Tcp};
let ep: IpEndpoint<Tcp> = IpEndpoint::new(IpAddrV4::loopback(), 80);
assert_eq!(ep.is_v6(), false);
let ep: IpEndpoint<Tcp> = IpEndpoint::new(IpAddrV6::loopback(), 80);
assert_eq!(ep.is_v6(), true);
Trait Implementations§
Source§impl<P: Clone> Clone for IpEndpoint<P>
impl<P: Clone> Clone for IpEndpoint<P>
Source§fn clone(&self) -> IpEndpoint<P>
fn clone(&self) -> IpEndpoint<P>
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 IpEndpoint<Icmp>
impl Debug for IpEndpoint<Icmp>
Source§impl Debug for IpEndpoint<Tcp>
impl Debug for IpEndpoint<Tcp>
Source§impl Debug for IpEndpoint<Udp>
impl Debug for IpEndpoint<Udp>
Source§impl<P: Protocol> Display for IpEndpoint<P>
impl<P: Protocol> Display for IpEndpoint<P>
Source§impl<P: IpProtocol> Endpoint<P> for IpEndpoint<P>
impl<P: IpProtocol> Endpoint<P> for IpEndpoint<P>
Source§impl<P: Hash> Hash for IpEndpoint<P>
impl<P: Hash> Hash for IpEndpoint<P>
Source§impl<P: Ord> Ord for IpEndpoint<P>
impl<P: Ord> Ord for IpEndpoint<P>
Source§fn cmp(&self, other: &IpEndpoint<P>) -> Ordering
fn cmp(&self, other: &IpEndpoint<P>) -> 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<P: PartialEq> PartialEq for IpEndpoint<P>
impl<P: PartialEq> PartialEq for IpEndpoint<P>
Source§impl<P: PartialOrd> PartialOrd for IpEndpoint<P>
impl<P: PartialOrd> PartialOrd for IpEndpoint<P>
Source§impl<P: Protocol> SockAddr for IpEndpoint<P>
impl<P: Protocol> SockAddr for IpEndpoint<P>
impl<P: Eq> Eq for IpEndpoint<P>
impl<P> StructuralPartialEq for IpEndpoint<P>
Auto Trait Implementations§
impl<P> Freeze for IpEndpoint<P>
impl<P> RefUnwindSafe for IpEndpoint<P>where
P: RefUnwindSafe,
impl<P> Send for IpEndpoint<P>where
P: Send,
impl<P> Sync for IpEndpoint<P>where
P: Sync,
impl<P> Unpin for IpEndpoint<P>where
P: Unpin,
impl<P> UnwindSafe for IpEndpoint<P>where
P: 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