Skip to main content

hyperlane_plugin_cache/
type.rs

1use super::*;
2
3/// Boxed `Send` future returned by async [`CacheStore`] trait methods.
4pub type CacheFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;
5
6/// Thread-safe shared reference to a pluggable [`CacheStore`].
7pub type SharedCacheStore = Arc<dyn CacheStore>;
8
9/// Fixed-size 64-way sharded cache entry map array.
10pub(crate) type CacheShardArray =
11    Box<[RwLock<HashMapXxHash3_64<String, Arc<CacheEntry>>>; CACHE_SHARD_COUNT]>;
12
13/// Fixed-size 64-way sharded single-flight inflight table.
14pub(crate) type InFlightShardArray =
15    Box<[Mutex<HashMapXxHash3_64<String, Arc<InFlightSlot>>>; CACHE_SHARD_COUNT]>;