Skip to main content

Crate rtb_assets

Crate rtb_assets 

Source
Expand description

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

§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.

Re-exports§

pub use assets::Assets;
pub use assets::AssetsBuilder;
pub use error::AssetError;
pub use source::AssetSource;
pub use source::DirectorySource;
pub use source::EmbeddedSource;
pub use source::MemorySource;

Modules§

assets
The Assets overlay container and its AssetsBuilder.
error
Typed errors for the asset subsystem.
source
The AssetSource trait and its three built-in implementations.