MCPcopy Create free account

hub / github.com/contain-rs/lru-cache / functions

Functions32 in github.com/contain-rs/lru-cache

↓ 35 callersMethodinsert
Inserts a key-value pair into the cache. If the key already existed, the old value is returned. # Examples ``` use lru_cache::LruCache; let mut cac
src/lib.rs:122
↓ 3 callersMethodremove
Removes the given key from the cache and returns its corresponding value. # Examples ``` use lru_cache::LruCache; let mut cache = LruCache::new(2);
src/lib.rs:172
↓ 2 callersMethodget_mut
Returns a mutable reference to the value corresponding to the given key in the cache, if any. # Examples ``` use lru_cache::LruCache; let mut cache
src/lib.rs:148
↓ 2 callersMethoditer
Returns an iterator over the cache's key-value pairs in least- to most-recently-used order. Accessing the cache through the iterator does _not_ affec
src/lib.rs:285
↓ 2 callersMethodlen
Returns the number of key-value pairs in the cache.
src/lib.rs:253
↓ 2 callersMethodremove_lru
(&mut self)
src/lib.rs:248
↓ 2 callersMethodset_capacity
Sets the number of key-value pairs the cache can hold. Removes least-recently-used key-value pairs if necessary. # Examples ``` use lru_cache::LruCa
src/lib.rs:225
↓ 1 callersMethodcapacity
Returns the maximum number of key-value pairs the cache can hold. # Examples ``` use lru_cache::LruCache; let mut cache: LruCache<i32, &str> = LruCa
src/lib.rs:189
↓ 1 callersMethodclear
Removes all key-value pairs from the cache.
src/lib.rs:263
↓ 1 callersMethoditer_mut
Returns an iterator over the cache's key-value pairs in least- to most-recently-used order, with mutable references to the values. Accessing the cach
src/lib.rs:318
Methodclone
(&self)
src/lib.rs:418
Methodcontains_key
Checks if the map contains the given key. # Examples ``` use lru_cache::LruCache; let mut cache = LruCache::new(1); cache.insert(1, "a"); assert_e
src/lib.rs:99
Methodextend
(&mut self, iter: I)
src/lib.rs:324
Methodfmt
(&self, f: &mut fmt::Formatter)
src/lib.rs:332
Methodheap_size_of_children
(&self)
src/heapsize.rs:9
Methodinto_iter
(self)
src/lib.rs:341
Methodis_empty
Returns `true` if the cache contains no key-value pairs.
src/lib.rs:258
Methodnew
Creates an empty cache that can hold at most `capacity` items. # Examples ``` use lru_cache::LruCache; let mut cache: LruCache<i32, &str> = LruCache
src/lib.rs:70
Methodnext
(&mut self)
src/lib.rs:391
Methodnext_back
(&mut self)
src/lib.rs:401
Methodsize_hint
(&self)
src/lib.rs:395
Functiontest_change_capacity
()
src/lib.rs:529
Functiontest_clear
()
src/lib.rs:578
Functiontest_contains_key
()
src/lib.rs:497
Functiontest_debug
()
src/lib.rs:540
Functiontest_expire_lru
()
src/lib.rs:504
Functiontest_iter
()
src/lib.rs:589
Functiontest_pop
()
src/lib.rs:516
Functiontest_put_and_get
()
src/lib.rs:478
Functiontest_put_update
()
src/lib.rs:488
Functiontest_remove
()
src/lib.rs:557
Methodwith_hasher
Creates an empty cache that can hold at most `capacity` items with the given hash builder.
src/lib.rs:80