Struct veilid_tools::IpAddrPort
source · pub struct IpAddrPort { /* private fields */ }
Implementations§
source§impl IpAddrPort
impl IpAddrPort
pub fn new(addr: IpAddr, port: u16) -> Self
pub fn addr(&self) -> &IpAddr
pub fn port(&self) -> u16
pub fn set_addr(&mut self, new_addr: IpAddr)
pub fn set_port(&mut self, new_port: u16)
pub fn from_socket_addr(sa: &SocketAddr) -> Self
pub fn to_socket_addr(&self) -> SocketAddr
Trait Implementations§
source§impl Clone for IpAddrPort
impl Clone for IpAddrPort
source§fn clone(&self) -> IpAddrPort
fn clone(&self) -> IpAddrPort
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 IpAddrPort
impl Debug for IpAddrPort
source§impl Display for IpAddrPort
impl Display for IpAddrPort
source§impl From<SocketAddrV4> for IpAddrPort
impl From<SocketAddrV4> for IpAddrPort
source§fn from(sock4: SocketAddrV4) -> IpAddrPort
fn from(sock4: SocketAddrV4) -> IpAddrPort
Converts to this type from the input type.
source§impl From<SocketAddrV6> for IpAddrPort
impl From<SocketAddrV6> for IpAddrPort
source§fn from(sock6: SocketAddrV6) -> IpAddrPort
fn from(sock6: SocketAddrV6) -> IpAddrPort
Converts to this type from the input type.
source§impl Hash for IpAddrPort
impl Hash for IpAddrPort
source§impl Ord for IpAddrPort
impl Ord for IpAddrPort
source§fn cmp(&self, other: &IpAddrPort) -> Ordering
fn cmp(&self, other: &IpAddrPort) -> 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 PartialEq for IpAddrPort
impl PartialEq for IpAddrPort
source§fn eq(&self, other: &IpAddrPort) -> bool
fn eq(&self, other: &IpAddrPort) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for IpAddrPort
impl PartialOrd for IpAddrPort
source§fn partial_cmp(&self, other: &IpAddrPort) -> Option<Ordering>
fn partial_cmp(&self, other: &IpAddrPort) -> Option<Ordering>
1.0.0 · source§fn 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 moreimpl Copy for IpAddrPort
impl Eq for IpAddrPort
impl StructuralPartialEq for IpAddrPort
Auto Trait Implementations§
impl Freeze for IpAddrPort
impl RefUnwindSafe for IpAddrPort
impl Send for IpAddrPort
impl Sync for IpAddrPort
impl Unpin for IpAddrPort
impl UnwindSafe for IpAddrPort
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
source§impl<T> CmpAssign for Twhere
T: Ord,
impl<T> CmpAssign for Twhere
T: Ord,
fn min_assign(&mut self, other: T)
fn max_assign(&mut self, other: T)
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more