MeiliSearch/meilisearch-lib/src/lib.rs

36 lines
669 B
Rust
Raw Normal View History

#[macro_use]
pub mod error;
pub mod options;
mod analytics;
pub mod index;
pub mod index_controller;
mod index_resolver;
mod snapshot;
pub mod tasks;
mod update_file_store;
2021-10-06 13:01:02 +02:00
pub use index_controller::MeiliSearch;
2021-09-28 22:08:03 +02:00
pub use milli;
2021-09-27 16:48:03 +02:00
mod compression;
pub mod document_formats;
2021-09-27 16:48:03 +02:00
use walkdir::WalkDir;
pub trait EnvSizer {
fn size(&self) -> u64;
}
impl EnvSizer for heed::Env {
fn size(&self) -> u64 {
WalkDir::new(self.path())
.into_iter()
.filter_map(|entry| entry.ok())
.filter_map(|entry| entry.metadata().ok())
.filter(|metadata| metadata.is_file())
.fold(0, |acc, m| acc + m.len())
}
}