#variables #chain #lookup #async

no-std varchain

Async-only chain-based variable lookup engine, support no_std with alloc

3 releases

Uses new Rust 2024

0.1.6 Feb 5, 2026
0.1.5 Feb 2, 2026
0.1.4 Feb 2, 2026
0.1.3 Feb 2, 2026

#1850 in Rust patterns


Used in nvr

MIT license

15KB
150 lines

Varchain

Async-only chain-based variable lookup engine, support no_std with alloc.

varchain provides a flexible way to resolve variables from a prioritized chain of sources (e.g., in-memory maps, environment variables, network lookups) without enforcing a specific runtime.

Features

  • Async-Only: Designed for asynchronous contexts from the ground up, compatible with any runtime (Tokio, async-std, smol, etc.) or just core::future.
  • Flexible Sources: Easy implementation of custom sources via the Source trait.
  • Composability: Build lookup scopes by chaining multiple sources with strict precedence.

Usage Examples

Check the examples directory for runnable code:

Installation

[dependencies]
varchain = { version = "0.1", features = ["full"] }

Feature Flags

Feature Description
std Enables standard library support for hashmap.
ahash Enables ahash::AHashMap support.
full Enables all features above.

License

Released under the MIT License © 2026 Canmi

Dependencies

~215KB