pub mod analyzer; pub mod config; pub mod detector; pub mod error; pub mod result; pub mod rule; pub mod utils;
pub use self::error::{RswResult, RswError};
pub use crate::config::rule::{
CustomConfigBuilder, RetryPolicy, RuleConfig, RuleOptions, RuleOrigin, RuleSource, RuleStage, RegexCacheConfig, RegexCache,
};
pub use crate::result::detect_result::{DetectResult, Technology};
pub use crate::rule::{RuleCacheManager, RuleLoader};
pub use crate::utils::extractor::HtmlExtractor;
pub use crate::utils::{DetectionUpdater, HeaderConverter, VersionExtractor, timing::time_it};
pub use crate::detector::{TechDetector};
#[cfg(feature = "embedded-rules")]
#[allow(clippy::all)]
#[allow(dead_code)]
#[allow(rust_analyzer::unresolved_env)] pub mod rswappalyzer_rules {
use once_cell::sync::Lazy;
use rswappalyzer_engine::{compiled::CompiledBundle};
use std::sync::Arc;
#[allow(dead_code)]
static COMPILED_BUNDLE: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/", env!("COMPILED_BUNDLE_FILENAME")));
pub static EMBEDDED_COMPILED_BUNDLE: Lazy<Arc<CompiledBundle>> = Lazy::new(|| {
let lib: CompiledBundle = serde_json::from_slice(&COMPILED_BUNDLE).unwrap_or_else(|e| {
eprintln!(
"Fatal error: Failed to deserialize embedded rule library - {:?}",
e
);
panic!(
"Failed to load embedded rule library. \
The embedded rules appear to be corrupted or incompatible. \
Please clean the build directory and rebuild the project."
);
});
Arc::new(lib)
});
}