Expand description
§Atom Manifest
This module provides the core types for working with an Atom’s manifest format. The manifest is a TOML file that describes an atom’s metadata and dependencies.
§Manifest Structure
Every atom must have a manifest file named atom.toml
that contains at minimum
an [atom]
section with the atom’s ID, version, and optional description.
Additional sections can specify dependencies and other configuration.
§Key Types
Manifest
- The complete manifest structureAtom
- The core atom metadata (id, version, description)AtomError
- Errors that can occur during manifest processing
§Example Manifest
[atom]
tag = "my-atom"
version = "1.0.0"
description = "A sample atom for demonstration"
[deps.atoms]
other-atom = { version = "^1.0.0", path = "../other-atom" }
[deps.pins]
external-lib = { url = "https://example.com/lib.tar.gz", hash = "sha256:abc123..." }
§Validation
Manifests are strictly validated to ensure they contain all required fields
and have valid data. The #[serde(deny_unknown_fields)]
attribute ensures
that only known fields are accepted, preventing typos and invalid configurations.
§Usage
use atom::manifest::Manifest;
use atom::{Atom, AtomTag};
use semver::Version;
// Create a manifest programmatically
let manifest = Manifest::new(
AtomTag::try_from("my-atom").unwrap(),
Version::new(1, 0, 0),
Some("My first atom".to_string()),
);
// Parse a manifest from a string
let manifest_str = r#"
[atom]
tag = "parsed-atom"
version = "2.0.0"
"#;
let parsed: Manifest = manifest_str.parse().unwrap();
Modules§
- deps
- Atom Dependency Handling
Structs§
- Manifest
- The type representing the required fields of an Atom’s manifest.
Enums§
- Atom
Error - Errors which occur during manifest (de)serialization.