Skip to main content

bake/
lib.rs

1//! Composable development tasks with typed arguments and shared context.
2//!
3//! Task attributes generate a sibling `function_task()` descriptor while
4//! preserving the original function for ordinary Rust calls. Register those
5//! descriptors explicitly and call [`Registry::run`] from your task binary.
6
7extern crate self as bake;
8
9mod arguments;
10mod context;
11mod error;
12mod output;
13mod registry;
14mod task;
15
16#[doc(hidden)]
17pub mod __private {
18    pub use crate::registry::{TASK_REGISTRATIONS, TaskRegistration};
19    pub use linkme;
20}
21
22pub use arguments::{Arguments, Parameter};
23pub use bake_macros::task;
24pub use context::Context;
25pub use error::{Error, Result};
26pub use output::Format;
27pub use registry::Registry;
28pub use serde_json::Value;
29pub use task::Task;
30
31/// Convert a task's output into the shared, serializable result format.
32pub fn value(output: impl serde::Serialize) -> Result<Value> {
33    serde_json::to_value(output).map_err(Error::from)
34}