Expand description
Tokio Bindings for Linux Kernel AIO
This package provides an integration of Linux kernel-level asynchronous I/O to the Tokio platform.
Linux kernel-level asynchronous I/O is different from the Posix AIO library. Posix AIO is implemented using a pool of userland threads, which invoke regular, blocking system calls to perform file I/O. Linux kernel-level AIO, on the other hand, provides kernel-level asynchronous scheduling of I/O operations to the underlying block device.
Structs§
- Atomic
Link - Link for intrusive collection, suitable for multi-threaded environments
- EventFd
- Tokio-aware EventFd implementation
- File
- AIO version of tokio
File
, to work throughGenericAioContextHandle
- Generic
AioContext - Represents running AIO context. Must be kept while AIO is in use.
In order to close it,
close
should be called. It will wait until all related futures are finished. Otherwise, if it just dropped, the termination will be triggered, but some running futures will continue running until they receive the data. - Generic
AioContext Handle - Cloneable handle to AIO context. Required for any AIO operations
- Local
Request Adapter - Locked
Buf - Buffer with fixed capacity, locked to RAM. It prevents memory from being paged to the swap area
- Noop
Lock - An unsafe (non-thread-safe) lock, equivalent to UnsafeCell
- Read
Flags - AIO read flags. See
io_submit
- Sync
Request Adapter - Write
Flags - AIO write flags. See
io_submit
Enums§
- AioCommand
Error - AIO command error
- AioContext
Error - AIO context creation error
- Locked
BufError - Error during
LockedBuf
creation - RawCommand
- Raw AIO command
Traits§
- AioOpen
Options Ext - Extension trait to
OpenOptions
to support opening files in AIO mode - Intrusive
Adapter - Intrusive adapter suitable for storing
Request
Functions§
- aio_
context - Create new AIO context suitable for cross-threaded environment (tokio rt-threaded),
backed by parking_lot Mutex. Automatically spawn background task, which polls
eventfd with
tokio::spawn
. - generic_
aio_ context - Create new AIO context with
nr
number of threads - local_
aio_ context - Create new AIO context suitable for single-threaded environment (tokio rt-core)
Type Aliases§
- AioContext
- AIO context suitable for cross-threaded environment (tokio rt-threaded), backed by parking_lot Mutex
- AioContext
Handle - AIO context handle suitable for cross-threaded environment (tokio rt-threaded), backed by parking_lot Mutex
- Local
AioContext - AIO context suitable for cross-threaded environment (tokio rt-core)
- Local
AioContext Handle - AIO context handle suitable for single-threaded environment (tokio rt-core)