feat: Add ability to inspect build information and features at runtime

Also re-adds ability to inspect used features
This commit is contained in:
Jade Ellis
2026-01-20 21:01:21 +00:00
parent 108a4fe336
commit 16de2a2cc0
26 changed files with 317 additions and 4 deletions
+1
View File
@@ -2,6 +2,7 @@
name = "conduwuit_core"
description.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
readme.workspace = true
repository.workspace = true
+7
View File
@@ -0,0 +1,7 @@
//! Information about features the crates were compiled with.
//! Only available for crates that have called the `introspect_crate` macro
use std::collections::BTreeMap;
pub static ENABLED_FEATURES: std::sync::Mutex<BTreeMap<&str, &[&str]>> =
std::sync::Mutex::new(BTreeMap::new());
+1
View File
@@ -1,3 +1,4 @@
pub mod introspection;
pub mod room_version;
pub mod version;
+3
View File
@@ -19,6 +19,7 @@ pub use ::smallstr;
pub use ::smallvec;
pub use ::toml;
pub use ::tracing;
pub use conduwuit_build_metadata as build_metadata;
pub use config::Config;
pub use error::Error;
pub use info::{
@@ -34,6 +35,8 @@ pub use utils::{implement, result, result::Result};
pub use crate as conduwuit_core;
conduwuit_macros::introspect_crate! {}
#[cfg(any(not(conduwuit_mods), not(feature = "conduwuit_mods")))]
pub mod mods {
#[macro_export]