Skip to main content

Crate rustledger_loader

Crate rustledger_loader 

Source
Expand description

Beancount file loader with include resolution.

This crate handles loading beancount files, resolving includes, and collecting options. It builds on the parser to provide a complete loading pipeline.

§Features

  • Recursive include resolution with cycle detection
  • Options collection and parsing
  • Plugin directive collection
  • Source map for error reporting
  • Push/pop tag and metadata handling
  • Automatic GPG decryption for encrypted files (.gpg, .asc)

§Example

use rustledger_loader::Loader;
use std::path::Path;

let result = Loader::new().load(Path::new("ledger.beancount"))?;
for directive in result.directives {
    println!("{:?}", directive);
}

Re-exports§

pub use cache::CacheEntry;
pub use cache::CachedOptions;
pub use cache::CachedPlugin;
pub use cache::invalidate_cache;
pub use cache::load_cache_entry;
pub use cache::reintern_directives;
pub use cache::save_cache_entry;

Modules§

cache
Binary cache for parsed ledgers.

Structs§

LoadResult
Result of loading a beancount file.
Loader
Beancount file loader.
Options
Beancount file options.
Plugin
A plugin directive.
SourceFile
A source file in the source map.
SourceMap
A map of source files for error reporting.

Enums§

LoadError
Errors that can occur during loading.

Functions§

load
Load a beancount file.