base_scheduler/socket_recv_result.rs
1// Released under the MIT License.
2// Copyright, 2026, by Samuel Williams.
3
4use crate::SocketAddress;
5
6/// Metadata from one receive. Only `bytes` bytes, spread across the buffers in order, were written; their initialized lengths remain unchanged.
7#[derive(Clone, Copy, Debug, Eq, PartialEq)]
8pub struct SocketRecvResult {
9 pub bytes: usize,
10 /// The sender when supplied by the OS, usually for datagrams. Stream receives may return `None`; use `socket_peer_address` for the connected peer.
11 pub address: Option<SocketAddress>,
12 /// A datagram exceeded the total buffer length. With nonzero capacity, remaining bytes were discarded unless this was a peek. Zero-capacity receive behavior is OS-specific. `bytes` is the copied length, not the original datagram length.
13 pub truncated: bool,
14 /// The OS reported discarded ancillary data. This initial interface supplies no control buffer; ancillary data requires a separate capability.
15 pub control_truncated: bool,
16}