Skip to main content

Crate rehearse

Crate rehearse 

Source
Expand description

Build typed operation plans, then describe, dry-run, or execute them.

rehearse records declared operation impact. It does not infer effects from arbitrary Rust code. A pipeline builds a static ordered Plan, and the runner decides whether each operation is only described, safely rehearsed, or fully executed.

The default macro frontend is available through #[operation] and #[pipeline]. The manual PlanBuilder API remains public for tests and lower-level integrations. Manual construction works with default features disabled:

use rehearse::{Impact, Operation, OperationMetadata, PlanBuilder};

let mut builder = PlanBuilder::<(), ()>::new("example");
let output = builder.add(Operation::sync(
    OperationMetadata::new("answer", Impact::Pure),
    (),
    |_, ()| Ok(42_u32),
));
let plan = builder.try_finish(output).expect("valid plan");
assert_eq!(plan.describe().len(), 1);

Re-exports§

pub use plan::Input;
pub use plan::IntoInput;
pub use plan::NodeId;
pub use plan::OperationInputs;
pub use plan::Plan;
pub use plan::PlanBuilder;
pub use plan::Value;

Modules§

plan

Macros§

step
Marker macro consumed by #[pipeline].

Structs§

ConsoleProgress
Progress listener that prints concise progress to stdout.
ConsoleProgressOptions
Options for ConsoleProgress.
DryRunFailure
Error returned by DryRunReport::require_no_failures.
DryRunIncomplete
Error returned by DryRunReport::require_complete.
DryRunReport
Structured report returned by dry-run mode.
NodeReport
Report row for one dry-run node.
NoopProgress
Progress listener that ignores every event.
Operation
A delayed operation descriptor.
OperationMetadata
Static metadata attached to an operation node.
PlanDescription
Owned static description of a plan.
PlanDescriptionRow
Static description row for one plan node.
PlanExecutionDescription
Owned static description of execute-mode plan order.
PlanExecutionDescriptionRow
Static execute-mode description row for one plan node.
ProgressNode
Static metadata for the node currently being reported.
SafeDryRun
Default conservative dry-run policy.

Enums§

DryRunAction
The action a dry-run policy assigns to an operation.
DryRunStatus
Aggregate dry-run status.
ExecuteError
Error returned by execute mode.
Impact
Declared impact for an operation.
InvariantError
An invariant failure in a validated plan or its per-run value store.
NodeOutcome
Outcome recorded for one dry-run node.
PlanBuildError
Invalid value reference found while constructing a plan. consumer: None identifies the selected final output.
ProgressEvent
Progress event emitted while describing or running a plan.
ProgressMode
Runtime mode that emitted a progress event.
ProgressOutcome
Node-level outcome observed by a progress listener.
ProgressPlanOutcome
Aggregate plan outcome observed by a progress listener.
ValueError
A checked failure to resolve a value from a run’s store.

Traits§

DryRunPolicy
Decides how each operation behaves during dry-run.
ProgressListener
Observes progress while a plan is described, dry-run, or executed.

Type Aliases§

BoxFuture
Runtime-independent boxed future used by operation executors.

Attribute Macros§

operation
Turns an async function into a delayed operation constructor.
pipeline
Lowers a straight-line plan constructor into PlanBuilder calls.