taskvisor/
lib.rs

1//! Public facade of the rustvisor crate.
2//!
3//! Public API (re-exports below) covers:
4//! - Observer trait (`Observer`) so applications can hook their own logging/metrics/etc
5//! - Policies / strategies (`RestartPolicy`, `BackoffStrategy`)
6//! - Orchestration (`Supervisor`)
7//! - Errors (`TaskError`, `RuntimeError`)
8//! - Task types (`TaskRef`, `TaskFn`, `TaskSpec`)
9//! - Configuration (`Config`)
10//!
11//! Optional API behind features:
12//! - `logging`: export a built-in `LoggerObserver` (demo/reference only)
13//! - `events`: export event types (`Event`, `EventKind`)
14
15mod actor;
16mod alive;
17mod bus;
18mod config;
19mod error;
20mod event;
21mod observer;
22mod policy;
23mod runner;
24mod strategy;
25mod supervisor;
26mod task;
27mod task_spec;
28// ---- Public re-exports ----
29
30pub use config::Config;
31pub use error::{RuntimeError, TaskError};
32pub use observer::Observer;
33pub use policy::RestartPolicy;
34pub use strategy::BackoffStrategy;
35pub use supervisor::Supervisor;
36pub use task::{TaskFn, TaskRef};
37pub use task_spec::TaskSpec;
38
39// Optional: expose event types (disabled by default).
40// Enable with: `--features events`
41#[cfg(feature = "events")]
42pub use crate::event::{Event, EventKind};
43
44// Optional: expose a simple built-in logger observer (demo/reference).
45// Not enabled by default to avoid forcing a logging opinion on users.
46// Enable with: `--features logging`
47#[cfg(feature = "logging")]
48pub use observer::LoggerObserver;