MCPcopy Index your code
hub / github.com/Thomasdezeeuw/a10

github.com/Thomasdezeeuw/a10 @v0.4.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.1 ↗ · + Follow
1,041 symbols 4,012 edges 66 files 197 documented · 19%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

The A10 I/O library. [^1]

This library is meant as a low-level library safely exposing different OS's abilities to perform non-blocking I/O.

On Linux A10 uses io_uring, which is a completion based API. For the BSD family of OS (FreeBSD, OpenBSD, NetBSD, etc.) and for the Apple family (macOS, iOS, etc.) this uses kqueue, which is a poll based API.

To support both the completion and poll based API most I/O operations need ownership of the data, e.g. a buffer, so it can delay deallocation if needed. [^2] The input data can be retrieved again by using the [Extract] trait.

Additional documentation can be found in the [io_uring(7)] and [kqueue(2)] manuals.

Examples

Examples can be found in the examples directory of the source code.

[^1]: The name A10 comes from the A10 ring road around Amsterdam, which relates to the ring buffers that io_uring uses in its design. [^2]: Delaying of the deallocation needs to happen for completion based APIs where an I/O operation Future is dropped before it's complete -- the OS will continue to use the resources, which would result in a use-after-free bug.

Extension points exported contracts — how you extend this code

SocketAddress (Interface)
Trait that defines the behaviour of socket addresses. Unix uses different address types for different sockets, to suppo [10 …
src/net.rs
Buf (Interface)
Trait that defines the behaviour of buffers used in writing, which requires read only access. # Safety Unlike normal b [14 …
src/io/traits.rs
DirectOp (Interface)
Operation that is done using a synchronous function. [8 implementers]
src/kqueue/op.rs
Extract (Interface)
Extraction of input arguments. See the [`Extract`] trait for more information. Extract input arguments from operations. [4 …
src/extract.rs
Op (Interface)
(no doc) [13 implementers]
src/io_uring/op.rs
AsyncIterator (Interface)
(no doc) [5 implementers]
tests/util/mod.rs
TestBuf (Interface)
NOTE: all implementations should be in the `all_bufs` macro. [1 implementers]
tests/functional/io.rs
OpPollResult (Interface)
(no doc) [2 implementers]
src/lib.rs

Core symbols most depended-on inside this repo

new
called by 329
tests/util/mod.rs
block_on
called by 175
tests/util/mod.rs
as_ptr
called by 60
src/io_uring/libc.rs
read
called by 55
src/fs.rs
len
called by 52
tests/functional/io.rs
open
called by 51
src/fs.rs
write
called by 47
src/fs.rs
drop
called by 41
tests/util/mod.rs

Shape

Method 428
Function 358
Class 209
Interface 31
Enum 15

Languages

Rust100%

Modules by API surface

src/io_uring/libc.rs64 symbols
src/fs.rs59 symbols
tests/util/mod.rs54 symbols
tests/functional/net.rs48 symbols
src/net.rs48 symbols
src/io_uring/op.rs41 symbols
tests/functional/fs.rs40 symbols
tests/functional/fs_notify.rs39 symbols
src/io/traits.rs37 symbols
tests/functional/io.rs33 symbols
src/io/read_buf.rs33 symbols
src/io/mod.rs33 symbols

For agents

$ claude mcp add a10 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact