1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Embedded-asset + overlay filesystem abstraction.
//!
//! Tools built on RTB ship assets from three places: compiled into the
//! binary via [`rust_embed`], on the user's disk (per-user overrides),
//! and in-memory (tests, scaffolders). [`Assets`] unifies these behind
//! a single read-only API.
//!
//! # Semantics
//!
//! * **Binary reads** ([`Assets::open`], [`Assets::open_text`],
//! [`Assets::exists`]) follow last-wins shadowing. The
//! highest-priority layer that provides the path supplies the bytes.
//! * **Directory listing** ([`Assets::list_dir`]) unions entries across
//! layers, deduplicated and sorted.
//! * **Structured merge** ([`Assets::load_merged_yaml`],
//! [`Assets::load_merged_json`]) reads the file from every layer that
//! has it and deep-merges via RFC-7396 merge-patch semantics — nested
//! maps merge recursively; scalars replace wholesale.
//!
//! # Construction
//!
//! ```
//! use rtb_assets::Assets;
//! use std::collections::HashMap;
//!
//! let assets = Assets::builder()
//! .memory(
//! "defaults",
//! HashMap::from([("greeting.txt".into(), b"hello".to_vec())]),
//! )
//! .build();
//!
//! assert_eq!(assets.open_text("greeting.txt").unwrap(), "hello");
//! ```
//!
//! See `docs/development/specs/2026-04-22-rtb-assets-v0.1.md` for the
//! authoritative contract.
pub use ;
pub use AssetError;
pub use ;