pub struct InetSocket {Show 22 fields
pub family: AddressFamily,
pub protocol: Protocol,
pub state: SocketState,
pub local: SocketAddr,
pub remote: SocketAddr,
pub interface: u32,
pub cookie: u64,
pub timer: Timer,
pub recv_q: u32,
pub send_q: u32,
pub uid: u32,
pub inode: u32,
pub refcnt: u32,
pub mark: Option<u32>,
pub cgroup_id: Option<u64>,
pub tcp_info: Option<TcpInfo>,
pub mem_info: Option<MemInfo>,
pub congestion: Option<String>,
pub tos: Option<u8>,
pub tclass: Option<u8>,
pub shutdown: Option<u8>,
pub v6only: Option<bool>,
}Expand description
Internet (TCP/UDP/SCTP) socket information.
Fields§
§family: AddressFamilyAddress family (IPv4 or IPv6).
protocol: ProtocolProtocol (TCP, UDP, etc.).
state: SocketStateSocket state.
local: SocketAddrLocal address and port.
remote: SocketAddrRemote address and port.
interface: u32Interface index (0 = any).
Socket cookie (unique identifier).
timer: TimerTimer information.
recv_q: u32Receive queue size.
send_q: u32Send queue size.
uid: u32Socket owner UID.
inode: u32Inode number.
refcnt: u32Reference count.
mark: Option<u32>Socket mark.
cgroup_id: Option<u64>Cgroup ID.
tcp_info: Option<TcpInfo>TCP-specific information.
mem_info: Option<MemInfo>Memory information.
congestion: Option<String>Congestion control algorithm.
tos: Option<u8>Type of service.
tclass: Option<u8>Traffic class (IPv6).
shutdown: Option<u8>Shutdown state (read/write).
v6only: Option<bool>IPv6 only flag.
Implementations§
Source§impl InetSocket
impl InetSocket
Sourcepub fn new(
family: AddressFamily,
protocol: Protocol,
state: TcpState,
local: SocketAddr,
remote: SocketAddr,
) -> Self
pub fn new( family: AddressFamily, protocol: Protocol, state: TcpState, local: SocketAddr, remote: SocketAddr, ) -> Self
Create a new InetSocket with minimal information.
Sourcepub fn is_listening(&self) -> bool
pub fn is_listening(&self) -> bool
Check if this is a listening socket.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if this is a connected socket.
Trait Implementations§
Source§impl Clone for InetSocket
impl Clone for InetSocket
Source§fn clone(&self) -> InetSocket
fn clone(&self) -> InetSocket
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 InetSocket
impl Debug for InetSocket
Source§impl Default for InetSocket
impl Default for InetSocket
Source§impl<'de> Deserialize<'de> for InetSocket
impl<'de> Deserialize<'de> for InetSocket
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for InetSocket
impl RefUnwindSafe for InetSocket
impl Send for InetSocket
impl Sync for InetSocket
impl Unpin for InetSocket
impl UnwindSafe for InetSocket
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