Struct TcpInfo
pub struct TcpInfo { /* private fields */ }net only.Expand description
Snapshot of the kernel’s state of a TCP connection.
Read with TcpInfo::try_from_socket (TCP_INFO on Linux and Android,
TCP_CONNECTION_INFO on Apple platforms, SIO_TCP_INFO on Windows).
A value the platform or kernel version does not report is None.
Implementations§
§impl TcpInfo
impl TcpInfo
pub fn try_from_socket(socket: &impl AsSocketRef) -> Result<TcpInfo, Error>
pub fn try_from_socket(socket: &impl AsSocketRef) -> Result<TcpInfo, Error>
Read the TcpInfo of a connected TCP socket.
Fails with io::ErrorKind::Unsupported on platforms other than
Linux, Android, Apple platforms and Windows.
pub fn rto(&self) -> Option<Duration>
pub fn rto(&self) -> Option<Duration>
Current retransmission timeout (Linux, Android, Apple; on Apple only while data is in flight).
pub fn rcv_ssthresh(&self) -> Option<u32>
pub fn rcv_ssthresh(&self) -> Option<u32>
Upper bound the receive window may currently grow to, in bytes (Linux, Android).
A value stuck near four segments while data flows means the kernel is holding the window down, e.g. under socket memory pressure.
pub fn notsent_bytes(&self) -> Option<u32>
pub fn notsent_bytes(&self) -> Option<u32>
Bytes written but not yet sent (Linux, Android).
pub fn bytes_sent(&self) -> Option<u64>
pub fn bytes_sent(&self) -> Option<u64>
Payload bytes sent, retransmissions included.
pub fn bytes_received(&self) -> Option<u64>
pub fn bytes_received(&self) -> Option<u64>
Payload bytes received.
pub fn bytes_retransmitted(&self) -> Option<u64>
pub fn bytes_retransmitted(&self) -> Option<u64>
Payload bytes retransmitted.
pub fn delivery_rate(&self) -> Option<u64>
pub fn delivery_rate(&self) -> Option<u64>
Most recent delivery rate estimate, in bytes per second (Linux, Android).
pub fn rwnd_limited(&self) -> Option<Duration>
pub fn rwnd_limited(&self) -> Option<Duration>
Part of Self::busy_time limited by the peer’s receive window
(Linux, Android).
pub fn sndbuf_limited(&self) -> Option<Duration>
pub fn sndbuf_limited(&self) -> Option<Duration>
Part of Self::busy_time limited by this end’s send buffer
(Linux, Android).
Trait Implementations§
Auto Trait Implementations§
impl Forget for TcpInfo
impl Freeze for TcpInfo
impl Move for TcpInfo
impl RefUnwindSafe for TcpInfo
impl Send for TcpInfo
impl Sync for TcpInfo
impl Unpin for TcpInfo
impl UnsafeUnpin for TcpInfo
impl UnwindSafe for TcpInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more