Skip to main content

crisol_core/
lib.rs

1//! The egui-free core of Crisol.
2//!
3//! This crate owns the parts of the workbench that must work without a window: the
4//! typed data model and its connectors, color tokens, theme palettes, size metrics,
5//! localization, versioned atomic storage, commands, application state, the host spec,
6//! the wire protocol, extension manifests, and agent permissions.
7//!
8//! It never depends on `egui`, `eframe`, `epaint`, `emath`, or `ecolor`. Colors are
9//! [`Rgba`], sizes are plain `f32` points, and time enters through a
10//! [`Clock`].
11//!
12//! The UI crate re-exports every module through `crisol::core`; applications should use
13//! that facade and never name this crate directly.
14//!
15//! ```
16//! use crisol_core::color::Rgba;
17//! use crisol_core::theme::{Theme, ThemeId};
18//!
19//! let theme = Theme::for_id(ThemeId::GithubLight);
20//! assert_eq!(theme.background, Rgba::from_rgb(0xff, 0xff, 0xff));
21//! ```
22//!
23//! # Features
24//!
25//! The default set is light: `serde`, `data`, and `storage`. Connectors (`csv`,
26//! `workbook`, `arrow`, `parquet`, `sqlite`, `ring`, `channel`) are opt-in. `sqlite` is
27//! native-only; every other feature builds on `wasm32-unknown-unknown`.
28
29#![forbid(unsafe_code)]
30#![deny(missing_docs)]
31// The crate denies unchecked indexing in production; tests index fixed fixtures.
32#![cfg_attr(test, allow(clippy::indexing_slicing))]
33#![cfg_attr(docsrs, feature(doc_cfg))]
34
35#[cfg(feature = "agent")]
36#[cfg_attr(docsrs, doc(cfg(feature = "agent")))]
37pub mod agent;
38pub mod color;
39pub mod commands;
40#[cfg(feature = "data")]
41#[cfg_attr(docsrs, doc(cfg(feature = "data")))]
42pub mod data;
43pub mod error;
44#[cfg(feature = "extensions")]
45#[cfg_attr(docsrs, doc(cfg(feature = "extensions")))]
46pub mod extensions;
47#[cfg(feature = "jobs")]
48#[cfg_attr(docsrs, doc(cfg(feature = "jobs")))]
49pub mod jobs;
50pub mod locale;
51pub mod metrics;
52#[cfg(feature = "protocol")]
53#[cfg_attr(docsrs, doc(cfg(feature = "protocol")))]
54pub mod protocol;
55#[cfg(feature = "spec")]
56#[cfg_attr(docsrs, doc(cfg(feature = "spec")))]
57pub mod spec;
58#[cfg(feature = "storage")]
59#[cfg_attr(docsrs, doc(cfg(feature = "storage")))]
60#[cfg(feature = "state")]
61#[cfg_attr(docsrs, doc(cfg(feature = "state")))]
62pub mod state;
63#[cfg(feature = "storage")]
64#[cfg_attr(docsrs, doc(cfg(feature = "storage")))]
65pub mod storage;
66pub mod theme;
67pub mod time;
68
69pub use color::Rgba;
70pub use commands::{Key, KeyChord, KeySequence, Modifiers};
71pub use error::CoreError;
72#[cfg(target_arch = "wasm32")]
73pub use time::PerformanceClock;
74#[cfg(all(feature = "threads", not(target_arch = "wasm32")))]
75pub use time::SystemClock;
76pub use time::{Clock, ManualClock};