pub struct RecvBuffer {
pub requested: usize,
pub granted: usize,
}Expand description
A socket receive buffer: what was asked for and what the kernel granted.
Fields§
§requested: usizeBytes requested with SO_RCVBUF.
granted: usizeBytes the kernel holds for datagrams, read back after the request.
Linux reports twice what it will queue — it doubles the request for
bookkeeping, socket(7) — so the read-back is halved there to compare
like with like.
Implementations§
Source§impl RecvBuffer
impl RecvBuffer
Sourcepub fn is_short(&self) -> bool
pub fn is_short(&self) -> bool
Whether the kernel granted less than half of the request — the point at which a burst the size of a frame no longer fits and the overflow is dropped by the kernel, where no counter of ours can see it.
Sourcepub fn limit_hint() -> &'static str
pub fn limit_hint() -> &'static str
The system limit that capped the request, by name, for the warning.
Trait Implementations§
Source§impl Clone for RecvBuffer
impl Clone for RecvBuffer
impl Copy for RecvBuffer
Source§impl Debug for RecvBuffer
impl Debug for RecvBuffer
impl Eq for RecvBuffer
Source§impl PartialEq for RecvBuffer
impl PartialEq for RecvBuffer
impl StructuralPartialEq for RecvBuffer
Auto Trait Implementations§
impl Freeze for RecvBuffer
impl RefUnwindSafe for RecvBuffer
impl Send for RecvBuffer
impl Sync for RecvBuffer
impl Unpin for RecvBuffer
impl UnsafeUnpin for RecvBuffer
impl UnwindSafe for RecvBuffer
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