pub enum AddressPair {
Unspecified,
Inet {
src_ip: Ipv4Addr,
dst_ip: Ipv4Addr,
src_port: u16,
dst_port: u16,
},
Inet6 {
src_ip: Ipv6Addr,
dst_ip: Ipv6Addr,
src_port: u16,
dst_port: u16,
},
Unix {
src_addr: [u8; 108],
dst_addr: [u8; 108],
},
}
Expand description
The address type, which can be either an IPv4/IPv6 address or a UNIX socket address.
Variants§
Unspecified
Address unspecified
Inet
The address is an IPv4 address.
Fields
Inet6
The address is an IPv6 address.
Fields
Unix
The address is a UNIX socket address.
Implementations§
Source§impl AddressPair
impl AddressPair
Sourcepub fn src_uni_addr(&self) -> Result<Option<SocketAddr>>
pub fn src_uni_addr(&self) -> Result<Option<SocketAddr>>
Returns the source address.
Sourcepub fn dst_uni_addr(&self) -> Result<Option<SocketAddr>>
pub fn dst_uni_addr(&self) -> Result<Option<SocketAddr>>
Returns the destination address.
Trait Implementations§
Source§impl Clone for AddressPair
impl Clone for AddressPair
Source§fn clone(&self) -> AddressPair
fn clone(&self) -> AddressPair
Returns a duplicate 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 AddressPair
impl Debug for AddressPair
Source§impl Hash for AddressPair
impl Hash for AddressPair
Source§impl PartialEq for AddressPair
impl PartialEq for AddressPair
impl Copy for AddressPair
impl Eq for AddressPair
impl StructuralPartialEq for AddressPair
Auto Trait Implementations§
impl Freeze for AddressPair
impl RefUnwindSafe for AddressPair
impl Send for AddressPair
impl Sync for AddressPair
impl Unpin for AddressPair
impl UnwindSafe for AddressPair
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