Skip to main content

tuwunel_core/
mod.rs

1//! Provides shared runtime foundations for Tuwunel.
2//!
3//! The crate centralizes configuration, errors, logging, metrics,
4//! server lifecycle state, and reusable utilities. Higher-level
5//! workspace crates build on these APIs.
6#![deny(missing_docs)]
7
8pub mod alloc;
9pub mod config;
10pub mod debug;
11pub mod error;
12pub mod info;
13pub mod log;
14pub mod matrix;
15pub mod metrics;
16pub mod mods;
17pub mod server;
18pub mod utils;
19
20pub use ::arrayvec;
21pub use ::either;
22pub use ::http;
23pub use ::itertools;
24pub use ::jsonwebtoken as jwt;
25pub use ::ruma;
26pub use ::smallstr;
27pub use ::smallvec;
28pub use ::tokio_metrics;
29pub use ::toml;
30pub use ::tracing;
31pub use config::Config;
32pub use error::Error;
33pub use info::{rustc_flags_capture, version, version::version};
34pub use server::{Progress, Server};
35pub use utils::{async_noinline, ctor, dtor, implement, result, result::Result};
36
37pub use crate as tuwunel_core;
38
39rustc_flags_capture! {}
40
41#[cfg(any(not(tuwunel_mods), not(feature = "tuwunel_mods")))]
42/// Provides inert dynamic-module hooks when module loading is unavailable.
43///
44/// The fallback keeps call sites portable across builds with and without the
45/// dynamic module feature. Its exported macros intentionally perform no work.
46pub mod mods {
47	use log as _;
48
49	#[macro_export]
50	/// Defines an empty module-constructor hook.
51	///
52	/// Builds without dynamic module support can keep the same `mod_ctor!`
53	/// invocation as enabled builds. Invoking it emits no constructor.
54	macro_rules! mod_ctor {
55		() => {};
56	}
57	#[macro_export]
58	/// Defines an empty module-destructor hook.
59	///
60	/// Builds without dynamic module support can keep the same `mod_dtor!`
61	/// invocation as enabled builds. Invoking it emits no destructor.
62	macro_rules! mod_dtor {
63		() => {};
64	}
65}