Rust API reference
Generate the Rust API reference with:
cargo doc --workspace --all-features --no-deps
On Windows:
.\scripts\build-rustdoc.ps1
The generated index is:
target/doc/nacelle/index.html
Start with these public entry points:
nacelle::prelude::*for common application imports.nacelle::core,nacelle::codec,nacelle::tcp,nacelle::http,nacelle::openssl,nacelle::rustls, andnacelle::runtimefor capability-oriented imports.nacelle::openssl::NacelleOpenSslConfigandnacelle::rustls::NacelleTlsConfigfor concrete provider configuration.nacelle::advanced::runtimefor raw executor and transport listener helpers when app/host composition is not sufficient.nacelle::NacelleApplistener registration andNacelleApp::run(...)for the app-first serving path across TCP, Unix sockets, HTTP, and TLS.nacelle::core::pipeline::Handlerfor typed shared-runtime handlers.nacelle::tcp::{NacelleTcpConfig, NacelleTcpLimits}for TCP buffering, framing, and timeout policy. These structs are non-exhaustive; construct them withDefaultand applywith_*builders so future fields retain their defaults.nacelle::runtime::{ThreadPerCoreConfig, WorkerSet}and therun_local_*_thread_per_core(...)functions for experimental Linux-only worker-local TCP, HTTP, Rustls, required OpenSSL, and optional OpenSSL execution. This mode requires explicit selection and does not silently fall back to the shared runtime.ThreadPerCoreConfig::with_max_threads(...)to cap the worker threads selected byWorkerSet::all(),WorkerSet::first(...), orWorkerSet::explicit(...)while preserving selection order. The shared runtime is caller-owned; configure its Tokio thread count on the runtime builder instead.nacelle::runtime::ThreadPerCoreLimits::Globalfor exact process-wide counters, orThreadPerCoreLimits::Workerfor partitioned worker-local counters. Worker mode enforces one shared hard memory ceiling across all workers whenexperimental-memoryis enabled.nacelle::runtime::WorkerContext::offload_blocking(...)for explicit blocking work whose completion is awaited back on the originating local worker.nacelle::tcp::Protocolfor TCP wire-format adapters.nacelle::tcp::{TcpServer, LocalTcpServer}forArc-backed connection state, orSerialTcpServer/LocalSerialTcpServerfor exclusive mutable state lent to one serial handler at a time.- With
experimental-memory,nacelle::tcp::TcpStreamingBodyMemoryPolicyto retain declared-length admission or account only live streaming chunks. NacelleAppandNacelleHostserial listener methods for plain TCP, required OpenSSL, optional OpenSSL, and Unix sockets.nacelle::runtime::run_local_serial_tcp_thread_per_core(...)andrun_local_serial_tcp_openssl_thread_per_core(...)for worker-local serial plain TCP and required OpenSSL. Userun_local_serial_tcp_optional_openssl_thread_per_core(...)when plaintext and OpenSSL must share one worker-local listener. Worker factories run once per worker, so externally bounded pools should be shared deliberately rather than constructed per worker.nacelle::core::{NacelleTelemetry, NacelleTelemetryConfig}for metrics and telemetry.nacelle::core::NacelleError::hint()with theerror-hintsfeature for optional operator guidance.NacelleError::Displayremains stable across feature combinations; applications append hints deliberately where suitable.- With
experimental-memory,nacelle::core::{NacelleMemoryBudget, NacelleMemoryAllocation}andNacelleRuntimeState::memory_budget()for shared application/transport memory budget allocations. Owned allocation guards can release retained capacity withNacelleMemoryAllocation::shrink_to(...). nacelle::tcp::TcpServer,nacelle::http::HyperServer,nacelle::runtime::NacelleHost, andnacelle::advanced::runtimewhen a service needs lower-level listener control.