tantivy-cache 0.4.0

tantivy caching for faster searching
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::path::Path;

use eyre::{OptionExt, Result};

/// Generates the key that should be used to store the offset of the footer for the
/// given path.
pub fn offset(path: &Path) -> Result<String> {
    let path = path.to_str().ok_or_eyre("invalid path")?;
    Ok(format!("offset:{path}"))
}

/// Generates the key that should be used to store the footer for the given path.
pub fn footer(path: &Path) -> Result<String> {
    let path = path.to_str().ok_or_eyre("invalid path")?;
    Ok(format!("footer:{path}"))
}