Std.LruCache
22 public declarations
- capacity
&Std.LruCache.LruCache[K, V] -> IntHow many entries the cache will hold before it starts discarding.
- cleared
&Std.LruCache.LruCache[K, V] -> Std.LruCache.LruCache[K, V]The cache holding nothing, keeping its capacity.
- containsKey
&Std.LruCache.LruCache[K, V] -> K -> BoolWhether a key is held, without marking it as used.
- evict
&Std.LruCache.LruCache[K, V] -> Std.LruCache.LruCache[K, V]The cache with its next entry discarded, unchanged when it is empty.
- fromPairs
&Array[(K, V)] -> Int -> Std.LruCache.LruCache[K, V]A cache of the given capacity holding these pairs, in the order given.
- get
&Std.LruCache.LruCache[K, V] -> K -> (Option[V], Std.LruCache.LruCache[K, V])The value stored under a key, and the cache with that key marked as used.
- getOrCompute
&Std.LruCache.LruCache[K, V] -> K -> fn(K) -> V -> (V, Std.LruCache.LruCache[K, V])The value under a key, computing and storing it when it is absent.
- isEmpty
&Std.LruCache.LruCache[K, V] -> BoolWhether the cache is holding nothing.
- isFull
&Std.LruCache.LruCache[K, V] -> BoolWhether the cache is holding as much as it can.
- keys
&Std.LruCache.LruCache[K, V] -> Array[K]Every key, least recently used first.
- LruCache
A map that holds only so much, and gives up what has gone longest unused.
- newest
&Std.LruCache.LruCache[K, V] -> Option[(K, V)]The most recently used entry, or `None` when the cache is empty.
- oldest
&Std.LruCache.LruCache[K, V] -> Option[(K, V)]The entry that will be discarded next, or `None` when the cache is empty.
- pairs
&Std.LruCache.LruCache[K, V] -> Array[(K, V)]Every entry as a pair, least recently used first.
- peek
&Std.LruCache.LruCache[K, V] -> K -> Option[V]The value stored under a key, without marking it as used.
- put
&Std.LruCache.LruCache[K, V] -> K -> V -> Std.LruCache.LruCache[K, V]The cache with an entry added or replaced, and marked as the most recently
- remove
&Std.LruCache.LruCache[K, V] -> K -> Std.LruCache.LruCache[K, V]The cache with a key's entry removed, or unchanged when there is none.
- resized
&Std.LruCache.LruCache[K, V] -> Int -> Std.LruCache.LruCache[K, V]The cache with a new capacity, discarding the oldest entries if it shrank.
- size
&Std.LruCache.LruCache[K, V] -> IntHow many entries the cache is holding.
- toMap
&Std.LruCache.LruCache[K, V] -> Map[K, V]The entries as an ordinary map, losing the recency order and the bound.
- values
&Std.LruCache.LruCache[K, V] -> Array[V]Every value, least recently used first.
- withCapacity
Int -> Std.LruCache.LruCache[K, V]A cache holding at most `capacity` entries.
