moka/
sync.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//! Provides thread-safe, concurrent cache implementations.

mod builder;
mod cache;
mod segment;
mod value_initializer;

pub use crate::sync_base::{iter::Iter, PredicateId};
pub use {builder::CacheBuilder, cache::Cache, segment::SegmentedCache};

/// Provides extra methods that will be useful for testing.
pub trait ConcurrentCacheExt<K, V> {
    /// Performs any pending maintenance operations needed by the cache.
    fn sync(&self);
}

// Empty internal struct to be used in optionally_get_with to represent the None
// results.
struct OptionallyNone;