IoUringSqe
struct IoUringSqeA 64-byte io_uring_sqe wrapper.
The wrapper owns its 64-byte buffer (allocated on heap on
construction, freed on drop). The :meth:as_bytes accessor
exposes the raw pointer so the upcoming SQ-ring writer can
memcpy it into the kernel's mmapped SQ array slot.
For SQEs constructed directly inside the kernel-mmapped SQ
region (the steady-state hot path), see :func:encode_sqe_at,
which writes the SQE in-place at a caller-supplied byte
pointer instead of allocating.
Construction zeros the 64-byte buffer; prep_* helpers
overwrite the relevant fields. Untouched fields stay zero —
matching the io_uring_prep_* family contract from
liburing.
Implements Movable
__init__
def __init__(out self) Allocate a 64-byte SQE buffer, zero-initialised.
__deinit__
def __deinit__(deinit self) Free the 64-byte buffer.
as_bytes
def as_bytes(self) -> Pointer[UInt8, MutUntrackedOrigin] Return the raw 64-byte buffer pointer.
The pointer's lifetime is tied to the SQE. Callers may
memcpy the bytes into a kernel SQ slot before the SQE
is dropped.
opcode
def opcode(self) -> Int Read the opcode byte.
flags
def flags(self) -> Int Read the SQE-level flags byte.
fd
def fd(self) -> Int Read the fd field as a signed 32-bit integer.
addr
def addr(self) -> UInt64 Read the addr field (u64).
len
def len(self) -> Int Read the len field (u32).
user_data
def user_data(self) -> UInt64 Read the user_data tag (u64).
op_flags
def op_flags(self) -> UInt32 Read the op-specific flags field (u32, offset 28).
For IORING_OP_RECV / IORING_OP_SEND this is the
msg_flags field (e.g. MSG_NOSIGNAL). NOTE: the
IORING_RECV_MULTISHOT / IORING_RECVSEND_POLL_FIRST
bits do NOT live here -- the kernel reads them from
:func:ioprio (sqe->ioprio @ offset 2). See
:func:prep_recv / :func:prep_recv_buffer_select for
the routing.
ioprio
def ioprio(self) -> UInt16 Read the ioprio field (u16, offset 2).
For multishot recv / send the kernel reads
IORING_RECV_MULTISHOT / IORING_RECVSEND_POLL_FIRST
from THIS field (NOT msg_flags). For multishot accept, the
kernel reads IORING_ACCEPT_MULTISHOT from this field.
set_flags
def set_flags(mut self, flags: UInt8) Set the SQE-level flags byte.
set_user_data
def set_user_data(mut self, tag: UInt64) Set the user_data tag returned in the matching CQE.