ass_editor/utils/indexing/
mod.rs1mod common;
7mod linear;
8
9#[cfg(feature = "search-index")]
10mod fst;
11#[cfg(feature = "search-index")]
12mod fst_build;
13#[cfg(feature = "search-index")]
14mod fst_search;
15
16#[cfg(test)]
17mod tests;
18
19pub use common::IndexEntry;
20pub use linear::LinearSearchIndex;
21
22#[cfg(feature = "search-index")]
23pub use fst::FstSearchIndex;
24
25use crate::utils::search::DocumentSearch;
26
27#[cfg(not(feature = "std"))]
28use alloc::boxed::Box;
29
30pub fn create_search_index() -> Box<dyn DocumentSearch> {
32 #[cfg(feature = "search-index")]
33 {
34 Box::new(FstSearchIndex::new())
35 }
36 #[cfg(not(feature = "search-index"))]
37 {
38 Box::new(LinearSearchIndex::new())
39 }
40}