Skip to main content

asimov_module/
lib.rs

1// This is free and unencumbered software released into the public domain.
2
3#![no_std]
4#![forbid(unsafe_code)]
5#![cfg_attr(docsrs, feature(doc_cfg))]
6
7extern crate alloc;
8
9#[cfg(feature = "std")]
10extern crate std;
11
12#[deprecated(since = "25.1.1", note = "Use `extern alloc` instead.")]
13pub use dogma::prelude;
14
15#[cfg(feature = "cli")]
16pub use clientele::{SysexitsError, SysexitsResult, args_os, dotenv, exit};
17
18#[cfg(feature = "std")]
19pub use getenv;
20
21pub use secrecy;
22
23#[cfg(not(feature = "tracing"))]
24pub mod tracing;
25
26#[cfg(feature = "tracing")]
27pub use tracing;
28
29#[cfg(feature = "tracing")]
30pub use tracing_subscriber;
31
32#[cfg(all(feature = "std", feature = "cli", feature = "tracing"))]
33pub fn init_tracing_subscriber(
34    options: &clientele::StandardOptions,
35) -> Result<(), alloc::boxed::Box<dyn core::error::Error + Send + Sync + 'static>> {
36    extern crate std;
37    tracing_subscriber::fmt()
38        .with_writer(std::io::stderr)
39        .with_max_level(options)
40        .with_level(options.debug || options.verbose > 0)
41        .with_target(options.debug)
42        .with_file(false)
43        .without_time()
44        .try_init()
45}
46
47pub use asimov_core::ModuleName;
48
49mod models;
50pub use models::*;
51
52pub mod resolve;
53
54#[cfg(all(feature = "serde", feature = "json"))]
55pub mod json;
56
57pub mod normalization;