Skip to main content

cargo_athena/
lib.rs

1//! `cargo-athena` — compile regular Rust into Argo Workflow YAML.
2//!
3//! This facade is the only crate users depend on. It re-exports the
4//! runtime ([`cargo_athena_core`]) and the proc macros
5//! ([`cargo_athena_macros`]) behind one stable `::cargo_athena` path, which is
6//! also the path the generated code targets.
7//!
8//! ```ignore
9//! use cargo_athena::{workflow, container};   // `host!` is used path-qualified
10//!
11//! #[workflow]
12//! fn run_foo() {
13//!     let a = some_other_workflow("asdf".to_string());
14//!     run_a_container(a);
15//! }
16//!
17//! #[container(image = "ghcr.io/acme/app:latest")]
18//! fn run_a_container(a: String) {
19//!     let cfg = cargo_athena::host!("/etc/myapp");  // -> hostPath volume; compile error outside #[container]/#[fragment]
20//!     println!("{cfg} {a}");
21//! }
22//!
23//! // entrypoint is a *type*; referencing it force-links the closure.
24//! fn main() { cargo_athena::entrypoint::<run_foo>(); }
25//! ```
26
27// Runtime: modes, registration, BuildCtx, YAML emit, `host!`, re-exported
28// `api` / `inventory` / `serde_json` / `serde_norway`.
29pub use cargo_athena_core::*;
30
31// `#[macro_export]` macros live at the dependency's crate root; re-export
32// explicitly so `cargo_athena::host!` resolves for users. `__cargo_athena_host`
33// is the private real macro the attribute macros rewrite visible `host!`s
34// into — it must be reachable at `::cargo_athena::__cargo_athena_host`.
35#[doc(hidden)]
36pub use cargo_athena_core::{
37    __cargo_athena_host, __cargo_athena_load_artifact, __cargo_athena_load_artifact_str,
38    __cargo_athena_save_artifact, __cargo_athena_save_artifact_str,
39};
40pub use cargo_athena_core::{
41    host, load_artifact, load_artifact_str, save_artifact, save_artifact_str,
42};
43
44// Attribute macros.
45pub use cargo_athena_macros::{container, fragment, workflow};