Expand description
battery-pack: Framework for building and using battery packs.
Battery packs are curated collections of crates that work well together.
The CLI (cargo bp) syncs real dependencies into your Cargo.toml,
and this library provides build-time validation to detect drift.
§For Battery Pack Authors
Your lib.rs should look like this:
ⓘ
const SELF_MANIFEST: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/Cargo.toml"));
pub fn validate() {
battery_pack::validate(SELF_MANIFEST);
}§For Battery Pack Users
Your build.rs should call validate:
ⓘ
fn main() {
cli_battery_pack::validate();
}Structs§
- Battery
Pack Spec - Parsed battery pack specification.
- DepSpec
- A dependency specification (version + features).
Functions§
- assert_
no_ regular_ deps - Assert that a battery pack manifest has no regular dependencies other than
battery-pack. - validate
- Validate that the calling crate’s dependencies match a battery pack’s specs.