runi_core/lib.rs
1//! Runi core library.
2//!
3//! `runi-core` hosts the foundation types shared across the Runi
4//! workspace (`Error`, `Result`, `Config`, `str_util`) and also acts as
5//! a feature-gated bundle that re-exports the other Runi sub-crates,
6//! so most callers only need a single dependency.
7//!
8//! Each workspace sub-crate (apart from the dev-only `runi-test`) is
9//! re-exported as a module named after the crate's suffix and gated by
10//! a feature of the same name — e.g. `runi-log` → `runi_core::log`
11//! under the `log` feature. The default features enable every bundled
12//! sub-crate; see `Cargo.toml` and the [book] for the current list.
13//!
14//! [book]: https://wvlet.github.io/runi/crates/runi-core.html
15//!
16//! ## Recommended: alias to `runi`
17//!
18//! The plain `runi` name on crates.io is held by an unrelated project,
19//! so this crate ships as `runi-core`. Cargo's `package` key lets each
20//! consumer rename the dependency at the call site, which gives you
21//! the clean `runi::` namespace without waiting on a name transfer:
22//!
23//! ```toml
24//! [dependencies]
25//! runi = { package = "runi-core", version = "0.1" } # everything bundled
26//! runi = { package = "runi-core", version = "0.1", default-features = false } # foundation only
27//! ```
28//!
29//! ```ignore
30//! use runi::{Error, Result};
31//! use runi::log;
32//! ```
33//!
34//! If you prefer, depend on `runi-core` directly and import as
35//! `runi_core::…`.
36//!
37//! The bundle role follows the pattern from
38//! [`wvlet/uni`](https://github.com/wvlet/uni).
39
40pub mod config;
41pub mod error;
42pub mod str_util;
43
44pub use config::Config;
45pub use error::{Error, Result};
46
47#[cfg(feature = "log")]
48pub use runi_log as log;
49
50#[cfg(feature = "cli")]
51pub use runi_cli as cli;