//! A reaped completion event.
usecrate::ffi::{IORING_CQE_BUFFER_SHIFT,IORING_CQE_F_BUFFER,IORING_CQE_F_MORE};/// One reaped completion (`struct io_uring_cqe`): the `user_data` you tagged
/// the submission with, and `res` (bytes transferred / accepted fd when ≥ 0,
/// else `-errno`).
#[repr(C)]#[derive(Clone, Copy, Debug)]pubstructCompletion{/// The `user_data` tag the submission carried.
pubuser_data:u64,
/// Result of the op: bytes transferred or accepted fd (≥ 0) or `-errno`.
pubres:i32,
/// io_uring `flags` (provided-buffer id + multishot armed bit).
pubflags:u32,
}implCompletion{/// The provided-buffer id the kernel filled, if this completion consumed
/// one (multishot/`recv` with buffer select). Recycle it via
/// [`ProvidedBufRing::recycle`](crate::ProvidedBufRing::recycle) once the
/// bytes are copied out.
pubfnbuffer_id(&self)->Option<u16>{(self.flags &IORING_CQE_F_BUFFER!=0).then_some((self.flags >>IORING_CQE_BUFFER_SHIFT)asu16)}/// Whether the originating multishot SQE remains armed (more completions
/// to come). When `false`, the op terminated and must be re-submitted.
pubfnhas_more(&self)->bool{self.flags &IORING_CQE_F_MORE!=0}}