Skip to main content

Crate vane_core

Crate vane_core 

Source
Expand description

§vane-core

The deterministic transport engine: pinned thread-per-core workers over io_uring (with a mio fallback), fixed buffer pools, a generational session slab, lock-free SPSC command paths, and kernel splice passthrough.

Layering:

┌────────────────────────────────────────────┐
│ vane (bin): HTTP handler, routing, filters │
├────────────────────────────────────────────┤
│ vane-core: Handler trait + Worker runtime  │
│   engine::uring  engine::mio_engine        │
│   buffer pool · session slab · SPSC · splice│
└────────────────────────────────────────────┘

The engine never allocates on the hot path: sessions live in a pre-reserved slab, IO buffers come from a fixed pool (registered with the kernel on io_uring), and cross-thread signaling is lock-free.

Re-exports§

pub use buffer::BufferPool;
pub use buffer::DEFAULT_BUF_SIZE;
pub use buffer::DEFAULT_POOL_SIZE;
pub use engine::Cqe;
pub use engine::Engine;
pub use engine::Poll;
pub use handler::Handler;
pub use handler::HandlerFactory;
pub use handler::Mode;
pub use handler::SessionIo;
pub use net::set_keepalive;
pub use net::set_nodelay;
pub use net::tcp_listener;
pub use slab::SessionSlab;
pub use slab::SlabError;
pub use spsc::SpscReceiver;
pub use spsc::SpscRing;
pub use spsc::SpscSender;
pub use token::Op;
pub use token::Token;
pub use worker::WorkerCmd;
pub use worker::WorkerConfig;
pub use worker::WorkerCtx;
pub use worker::WorkerHandle;
pub use worker::spawn as spawn_worker;

Modules§

buffer
Fixed buffer pool (IORING_REGISTER_BUFFERS semantics, IO-02).
engine
The AsyncEngine abstraction — completion-based transport (IO-01, IO-05).
h2
Native HTTP/2 engine (PR-02): HPACK, frame codec, and the connection/stream state machines over the completion engine.
handler
Handler trait — the L4/L7 plug-in point between the transport engine and protocol logic (HTTP parsing/routing lives above this; L4 splice below).
net
Socket setup helpers: listeners with SO_REUSEPORT (one per worker for share-nothing accept), nonblocking tuning, keepalive.
slab
Thread-local generational slab for connection sessions (MM-01).
splice
L4 passthrough plumbing — zero user-space data copies (IO-04).
spsc
Cacheline-padded, lock-free SPSC ring for cross-thread signaling (TH-02).
token
Completion tokens: routing CQEs back to the session and operation that produced them.
worker
Worker — the pinned, share-nothing thread that owns an engine, a buffer pool, a session slab, and a handler (TH-01, MM-01).

Macros§

dbg_trace
Forensic trace print (no-op build).