Skip to main content

tuwunel_core/
mod.rs

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