pub enum SocketAddr {
V4(SocketAddrV4),
V6(SocketAddrV6),
}
Variants§
Implementations§
Source§impl SocketAddr
impl SocketAddr
pub fn new(ip: IpAddress, port: u16) -> Result<Self, Error>
pub fn new_v4(ip: Ipv4Address, port: u16) -> Self
pub fn v4_from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn new_ip4_port(a0: u8, a1: u8, a2: u8, a3: u8, port: u16) -> Self
pub fn new_v6(ip: Ipv6Address, port: u16) -> Self
pub fn v6_from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn new_ip6_port( a0: u16, a1: u16, a2: u16, a3: u16, a4: u16, a5: u16, a6: u16, a7: u16, port: u16, ) -> Self
pub fn len(&self) -> usize
pub fn ip(&self) -> IpAddress
pub fn ip_octets(&self) -> Vec<u8> ⓘ
pub fn port(&self) -> u16
pub fn to_vec(&self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for SocketAddr
impl Clone for SocketAddr
Source§fn clone(&self) -> SocketAddr
fn clone(&self) -> SocketAddr
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 SocketAddr
impl Debug for SocketAddr
Source§impl Display for SocketAddr
impl Display for SocketAddr
Source§impl From<&SocketAddr> for SocketAddr
impl From<&SocketAddr> for SocketAddr
Source§fn from(val: &SocketAddr) -> Self
fn from(val: &SocketAddr) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddr> for IpEndpoint
impl From<SocketAddr> for IpEndpoint
Source§fn from(val: SocketAddr) -> Self
fn from(val: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddr> for SocketAddr
impl From<SocketAddr> for SocketAddr
Source§fn from(val: SocketAddr) -> Self
fn from(val: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddr> for SocketAddr
impl From<SocketAddr> for SocketAddr
Source§fn from(val: StdSocketAddr) -> Self
fn from(val: StdSocketAddr) -> Self
Converts to this type from the input type.
Source§impl Hash for SocketAddr
impl Hash for SocketAddr
Source§impl PartialEq for SocketAddr
impl PartialEq for SocketAddr
impl Copy for SocketAddr
impl Eq for SocketAddr
impl StructuralPartialEq for SocketAddr
Auto Trait Implementations§
impl Freeze for SocketAddr
impl RefUnwindSafe for SocketAddr
impl Send for SocketAddr
impl Sync for SocketAddr
impl Unpin for SocketAddr
impl UnwindSafe for SocketAddr
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