pub struct BloomFilterCache { /* private fields */ }Expand description
Thread-safe cache of per-file Bloom filters, keyed by path and validated by mtime. Stale entries are automatically rebuilt on access.
Implementations§
Source§impl BloomFilterCache
impl BloomFilterCache
Sourcepub fn contains(
&self,
path: &Path,
mtime: SystemTime,
content: &str,
symbol: &str,
) -> bool
pub fn contains( &self, path: &Path, mtime: SystemTime, content: &str, symbol: &str, ) -> bool
Check if symbol might appear in the file at path.
- If a cached filter exists with matching
mtime, queries it directly. - Otherwise, builds a new filter from
content, caches it, then queries.
Returns true if the symbol MIGHT be in the file (possible false positive),
false if it is DEFINITELY absent.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BloomFilterCache
impl !RefUnwindSafe for BloomFilterCache
impl Send for BloomFilterCache
impl Sync for BloomFilterCache
impl Unpin for BloomFilterCache
impl UnsafeUnpin for BloomFilterCache
impl UnwindSafe for BloomFilterCache
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more