Skip to main content

actionqueue_core/
lib.rs

1#![forbid(unsafe_code)]
2//! Core utilities and abstractions for the ActionQueue system.
3//!
4//! This crate provides the core domain types for the ActionQueue task execution system,
5//! including run state management, task specifications, and unique identifiers.
6//!
7//! # Overview
8//!
9//! The core crate defines the fundamental types used throughout the ActionQueue system:
10//!
11//! - [`ids`] - Unique identifiers for tasks, runs, and attempts
12//! - [`mutation`] - Engine-facing mutation authority boundary contracts
13//! - [`run`] - Run state machine and instance management
14//! - [`task`] - Task specifications and constraints
15//!
16//! # Example
17//!
18//! ```
19//! use actionqueue_core::ids::{RunId, TaskId};
20//! use actionqueue_core::run::{RunInstance, RunState};
21//!
22//! // Create a new task ID
23//! let task_id = TaskId::new();
24//!
25//! // Create a new run instance in Scheduled state
26//! let run = RunInstance::new_scheduled(task_id, 1000u64, 500u64)
27//!     .expect("run construction should be valid");
28//!
29//! // Verify the run starts in Scheduled state
30//! assert_eq!(run.state(), RunState::Scheduled);
31//! assert!(!run.is_terminal());
32//!
33//! // Create a transition to Ready state
34//! use actionqueue_core::run::Transition;
35//! let transition = Transition::new(RunState::Scheduled, RunState::Ready);
36//! assert!(transition.is_ok());
37//! ```
38
39pub mod actor;
40pub mod budget;
41/// System events for subscription matching and dispatch coordination.
42pub mod event;
43/// Strongly-typed identifiers used across task/run/attempt domain entities.
44pub mod ids;
45pub mod mutation;
46pub mod platform;
47pub mod run;
48pub mod subscription;
49pub mod task;
50pub mod time;