Skip to main content

ostraka_core/
lib.rs

1//! Domain types for Ostraka.
2//!
3//! This crate holds types and parsing only. It spawns no processes, performs no
4//! IO beyond reading configuration, and depends on nothing but serde, toml and
5//! thiserror. Keeping it inert is what lets every other crate agree on the same
6//! vocabulary without inheriting a runtime.
7
8pub mod clock;
9pub mod config;
10pub mod gate;
11pub mod identity;
12pub mod manifest;
13pub mod policy;
14pub mod record;
15pub mod task;
16
17use thiserror::Error;
18
19/// Anything that can go wrong while reading or validating configuration.
20#[derive(Debug, Error)]
21pub enum Error {
22    #[error("failed to parse {what}: {source}")]
23    Parse {
24        what: &'static str,
25        #[source]
26        source: toml::de::Error,
27    },
28
29    #[error("{0}")]
30    Invalid(String),
31}
32
33pub type Result<T> = std::result::Result<T, Error>;