Module io_uring

Available on crate feature dep_rustix only.
Expand description

Linux io_uring.

This API is very low-level. The main adaptations it makes from the raw Linux io_uring API are the use of appropriately-sized bitflags, enum, Result, OwnedFd, AsFd, RawFd, and *mut c_void in place of plain integers.

For a higher-level API built on top of this, see the rustix-uring crate.

§Safety

io_uring operates on raw pointers and raw file descriptors. Rustix does not attempt to provide a safe API for these, because the abstraction level is too low for this to be practical. Safety should be introduced in higher-level abstraction layers.

§References

Structs§

AtFlags
AT_* constants for use with openat, statat, and other *at functions.
EpollEvent
A record of an event that occurred.
EpollEventFlags
EPOLL* for use with epoll::add.
IoringAcceptFlags
accept flags (sqe.ioprio)
IoringAsyncCancelFlags
IORING_ASYNC_CANCEL_* flags for use with io_uring_sqe.
IoringCqFlags
IORING_CQ_* flags.
IoringCqeFlags
IORING_CQE_F_* flags for use with io_uring_cqe.
IoringEnterFlags
IORING_ENTER_* flags for use with io_uring_enter.
IoringFeatureFlags
IORING_FEAT_* flags for use with io_uring_params.
IoringFsyncFlags
IORING_FSYNC_* flags for use with io_uring_sqe.
IoringMsgringFlags
IORING_MSG_RING_* flags for use with io_uring_sqe.
IoringOpFlags
IO_URING_OP_* flags for use with io_uring_probe_op.
IoringPollFlags
IORING_POLL_* flags.
IoringRecvFlags
recv/recvmsg flags (sqe.ioprio)
IoringRegisterFlags
IORING_REGISTER_* flags for use with io_uring_register_with.
IoringRsrcFlags
IORING_RSRC_* flags for use with io_uring_rsrc_register.
IoringSendFlags
send/sendmsg flags (sqe.ioprio)
IoringSetupFlags
IORING_SETUP_* flags for use with io_uring_params.
IoringSqFlags
IORING_SQ_* flags.
IoringSqeFlags
IOSQE_* flags for use with io_uring_sqe.
IoringTimeoutFlags
IORING_TIMEOUT_* and IORING_LINK_TIMEOUT_UPDATE flags for use with io_uring_sqe.
Mode
S_I* constants for use with openat, chmodat, and fchmod.
OFlags
O_* constants for use with openat.
ReadWriteFlags
RWF_* constants for use with preadv2 and pwritev2.
RecvFlags
MSG_* flags for use with recv, recvfrom, and related functions.
RecvmsgOutFlags
recvmsg out flags
RenameFlags
RENAME_* constants for use with renameat_with.
ResolveFlags
RESOLVE_* constants for use with openat2.
SendFlags
MSG_* flags for use with send, sendto, and related functions.
SocketFlags
SOCK_* constants for use with socket_with, accept_with and acceptfrom_with.
SpliceFlags
SPLICE_F_* flags for use with io_uring_sqe.
StatxFlags
STATX_* constants for use with statx.
XattrFlags
XATTR_* constants for use with setxattr, and other *setxattr functions.
addr3_struct
addr_len_struct
buf_ring_bufs_struct
buf_ring_tail_struct
cmd_op_struct
io_cqring_offsets
io_sqring_offsets
io_uring_buf
io_uring_buf_reg
io_uring_buf_ring
io_uring_cqe
An io_uring Completion Queue Entry.
io_uring_files_update
io_uring_getevents_arg
io_uring_params
io_uring_probe
io_uring_probe_op
io_uring_ptr
A pointer in the io_uring API.
io_uring_recvmsg_out
io_uring_restriction
io_uring_rsrc_register
io_uring_rsrc_update
io_uring_rsrc_update2
io_uring_sqe
An io_uring Submission Queue Entry.
io_uring_sync_cancel_reg
iovec
msghdr
open_how
sockaddr
sockaddr_storage
tail_or_bufs_struct

Enums§

Advice
POSIX_FADV_* constants for use with fadvise.
IoringMsgringCmds
IORING_MSG_* constants which represent commands for use with IoringOp::MsgRing, (seq.addr)
IoringOp
IORING_OP_* constants for use with io_uring_sqe.
IoringRegisterOp
IORING_REGISTER_* and IORING_UNREGISTER_* constants for use with io_uring_register.
IoringRestrictionOp
IORING_RESTRICTION_* constants for use with io_uring_restriction.

Constants§

IORING_CQE_BUFFER_SHIFT
IORING_FILE_INDEX_ALLOC
IORING_NOTIF_USAGE_ZC_COPIED
IORING_NOTIF_USAGE_ZC_COPIED (since Linux 6.2)
IORING_OFF_CQ_RING
IORING_OFF_SQES
IORING_OFF_SQ_RING

Functions§

io_uring_enter
io_uring_enter(fd, to_submit, min_complete, flags, arg, size)—Initiate and/or complete asynchronous I/O.
io_uring_register
io_uring_register(fd, opcode, arg, nr_args)—Register files or user buffers for asynchronous I/O.
io_uring_register_files_skip
IORING_REGISTER_FILES_SKIP
io_uring_register_with
io_uring_register_with(fd, opcode, flags, arg, nr_args)—Register files or user buffers for asynchronous I/O.
io_uring_setup
io_uring_setup(entries, params)—Setup a context for performing asynchronous I/O.

Type Aliases§

Nsecs
A type for the tv_sec field of Timespec.
Secs
A type for the tv_sec field of Timespec.
Statx
struct statx for use with statx.
Timespec
struct timespec
c_char
The C char type.
sigset_t
socklen_t

Unions§

EpollEventData
Data associated with an epoll::Event. This can either be a 64-bit integer value or a pointer which preserves pointer provenance.
addr3_or_cmd_union
addr_or_splice_off_in_union
buf_union
io_uring_user_data
User data in the io_uring API.
ioprio_union
len_union
off_or_addr2_union
op_flags_union
register_or_sqe_op_or_sqe_flags_union
splice_fd_in_or_file_index_union