Thanks to visit codestin.com
Credit goes to lib.rs

Cargo Features

FSYS has no features set by default.

[dependencies]
fsys = { version = "1.1.0", features = ["async", "stress", "fuzz", "tracing", "oom_inject", "spdk"] }

FEATURES

async

Async layer (locked decision D-1 in .dev/DECISIONS-0.6.0.md). Adds _async siblings to every sync method via tokio::task::spawn_blocking; async batch ops via tokio::sync::oneshot. Pulls in tokio's rt, rt-multi-thread, sync, macros features.

Enables tokio

Tokio runtime — gated behind the async feature flag. Feature set rationale (locked decision D-10 in .dev/DECISIONS-0.6.0.md):

  • rt + rt-multi-thread: required for spawn_blocking and #[tokio::test(flavor = "multi_thread")] for batch tests.
  • sync: required for tokio::sync::oneshot (async batch response channel per locked decision D-5).
  • macros: required for #[tokio::test]. fs was dropped in 0.6.0 — fsys's async layer uses spawn_blocking against the sync core, never tokio's fs primitives.

Affects fsys::async_io

stress

Stress / soak test harnesses (locked decision D-7). Tests gated behind this flag run for the full 1-hour duration; without the flag they compile but skip the long-running body. CI nightly enables this for full-duration validation; dev iteration uses short validation runs.

fuzz

Fuzz harness wiring. Compile-only flag — actual fuzz target binaries live in the fuzz/ directory and use cargo-fuzz. This flag exists so library code that supports fuzz instrumentation can be conditionally enabled without it bloating release builds.

tracing

Opt-in tracing instrumentation. Adds spans + events on the write / read / journal hot paths. Off by default — the tracing macros compile to no-ops when the dep is absent, so there's zero overhead for non-tracing builds. Enable this in production observability environments where tracing subscribers (tokio-console, OpenTelemetry, etc.) are already wired.

Enables tracing

Optional structured-event instrumentation. Gated behind the tracing feature flag; when off, the dep isn't pulled in. tracing's macros (trace_span!, debug!, etc.) compile to no-ops in the absence of the dep — fsys's own code uses them unconditionally inside #[cfg(feature = "tracing")] blocks so the no-op-on-absent-feature property is enforced by the type system, not just convention.

oom_inject

0.9.7 H-9 / H-7 — internal test-hooks feature. Replaces the system global allocator with an OOM-injecting one that tests can program (via thread-local size threshold) to fail allocs above a target size. NEVER enable in production builds — every allocation goes through an extra dispatch + threshold check. The feature is here to make the integration test tests/oom_injection.rs compileable; CI runs it as a separate matrix entry with --features oom_inject and the production matrix never sees it.

Affects fsys::test_support

spdk

1.1.0 — SPDK (Storage Performance Development Kit) backend for the journal substrate. Kernel-bypass NVMe access on Linux server workloads with pre-allocated hugepages, IOMMU, and unbound NVMe devices. The backend implementation lives in the companion crate fsys-spdk (separate to keep DPDK / C-binding weight off users who don't need it). With this feature OFF, Method::Spdk is present in the public enum but selecting it returns Error::FeatureNotEnabled. With this feature ON, fsys depends on fsys-spdk and the SPDK backend becomes selectable on Linux when the capability probe reports spdk_eligible = true.

In 1.1.0 the fsys-spdk crate is in scaffold state — the feature is wired through the public API surface (capability cache, error variants, Method::Spdk, builder methods, observability accessors) so 1.1 consumers can write code against the 1.x-stable interface today, but selecting the backend on Linux will return Error::SpdkUnavailable until the implementation lands. The fsys-spdk companion crate is published separately; see docs/SPDK.md for the setup requirements and rollout.

Features from optional dependencies

DEPENDENCIES