pub struct SearchResultCache { /* private fields */ }Expand description
Cross-process cache client: tries a background TCP server; falls back to local cache.
Implementations§
Source§impl SearchResultCache
impl SearchResultCache
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a cache client. Prefers a background TCP server unless disabled.
Sourcepub fn with_cache_dir(cache_dir: PathBuf) -> Result<Self>
pub fn with_cache_dir(cache_dir: PathBuf) -> Result<Self>
Test helper: force cache to use a specific directory (local only).
pub fn get( &self, file: &Path, query: &str, case_sensitive: bool, current_mtime: SystemTime, current_size: u64, ) -> Option<Vec<TranslationEntry>>
pub fn set( &self, file: &Path, query: &str, case_sensitive: bool, mtime: SystemTime, file_size: u64, results: &[TranslationEntry], ) -> Result<()>
pub fn clear(&self) -> Result<()>
Sourcepub fn start_server_blocking() -> Result<()>
pub fn start_server_blocking() -> Result<()>
Hidden entrypoint: block and run cache server.
Auto Trait Implementations§
impl !Freeze for SearchResultCache
impl !RefUnwindSafe for SearchResultCache
impl Send for SearchResultCache
impl Sync for SearchResultCache
impl Unpin for SearchResultCache
impl !UnwindSafe for SearchResultCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more