shep_core/lib.rs
1//! Shared foundation of the shep workspace
2//!
3//! Typed configuration (Flockfile + daemon config), value newtypes,
4//! process selectors, `$SHEP_HOME` paths, and wire protocol version 1.
5//! Every other crate depends on this one; it depends on no sibling.
6//!
7//! # Quick start
8//! ```
9//! use shep_core::prelude::*;
10//!
11//! let app: AppConfig = toml::from_str("name = \"web\"\nscript = \"./srv\"").unwrap();
12//! assert!(app.autorestart);
13//! let limit: MemSize = "512M".parse().unwrap();
14//! assert_eq!(limit.bytes(), 512 << 20);
15//! ```
16//!
17//! Module-by-module design: `docs/systematic-refactor/refactor-workspace/map.md`;
18//! behavior contract: `docs/specs/shep-v1.md`.
19
20#![doc(test(attr(deny(warnings))))]
21#![forbid(unsafe_code)]
22
23pub mod barks;
24pub mod config;
25pub mod kv;
26// One definition of the log-line timestamp for the writer and every reader:
27// the daemon stamps, and three different file readers in shep-cli strip.
28pub mod logstamp;
29pub mod overrides;
30pub mod paths;
31pub mod protocol;
32pub mod selector;
33pub mod signals;
34pub mod status;
35// Declared next to `protocol`, deliberately: that module owns what travels
36// over the control plane and this one owns what carries it. Keeping the two
37// in one crate is what lets every layer above them — the client's actor, the
38// daemon's connection state machine, every RPC verb — be written once with
39// no `cfg` in it at all.
40pub mod transport;
41pub mod values;
42
43/// One-import surface for downstream crates
44pub mod prelude {
45 #[doc(no_inline)]
46 pub use crate::config::{AppConfig, DeclaredApp, Flockfile};
47 #[doc(no_inline)]
48 pub use crate::paths::ShepPaths;
49 #[doc(no_inline)]
50 pub use crate::selector::ProcessSelector;
51 #[doc(no_inline)]
52 pub use crate::status::ProcStatus;
53 #[doc(no_inline)]
54 pub use crate::values::{MemSize, UpDuration};
55}