yaml-datastore

Crates.ioyaml-datastore
lib.rsyaml-datastore
version
sourcesrc
created_at2025-03-27 01:27:59.736128+00
updated_at2025-03-27 01:27:59.736128+00
descriptionAPI for using a set of YAML files as a cohesive datastore.
homepage
repositoryhttp://github.com/dfego/yaml-datastore/
max_upload_size
id1607416
Cargo.toml error:TOML parse error at line 22, column 1 | 22 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Dan Fego (dfego)

documentation

README

yaml-datastore

API for using a set of YAML files as a cohesive datastore.

What this crate supports is having a set of YAML files be accessible as a single, uniform datastore. So for example, if you had a set of YAML files all containing structured data, you could use this crate to query specific values from it. In effect, it's an ergonomic wrapper for managing a set of files doing the file I/O, and pulling specific elements out of those files.

Usage

Assume there is a set of YAML files under tests/data/, and within exists a file named complete.yaml with the following content:

name: Complete
id: 1
rating: 1.0
complete: true
tags:
  - complete
  - done
  - finished
nested:
  value: true

To access the true contained under nested -> value, you can do the following:

use yaml_datastore::Datastore;

let datastore: Datastore = Datastore::open("tests/data");
let parsed: bool = datastore.get("complete.nested.value").unwrap();
assert!(parsed);

See the [Datastore] and [keypath] documentation for more information on how the keypaths are resolved into values.

Commit count: 0

cargo fmt