MCPcopy Create free account

hub / github.com/a-agmon/LocalLRU / functions

Functions20 in github.com/a-agmon/LocalLRU

↓ 13 callersMethodadd_item
Adds an item to the cache. # Arguments `key` - The key to add the item for. `value` - The value to add to the cache represented as `Bytes`.
src/lib.rs:99
↓ 3 callersMethodget_item
Gets an item from the cache. In LRU cache fetching, the item is moved to the front of the list. # Returns An Option containing the item if it exists,
src/lib.rs:82
↓ 3 callersMethodmove_to_head
Moves the given node to the front of the list. This function is called when the item is accessed.
src/cache.rs:94
↓ 3 callersMethodremove_node
Removes the given node from the list.
src/cache.rs:101
↓ 2 callersMethodadd_to_head
Adds the given node to the front of the list.
src/cache.rs:128
↓ 2 callersMethodget_struct
Wrapper function to get a struct from the cache. It uses bincode to deserialize the Bytes object back into a struct. # Arguments `key` - The key to g
src/lib.rs:129
↓ 2 callersMethodinitialize_cache_if_none
(&self)
src/lib.rs:70
↓ 1 callersMethodadd_struct
Wrapper function to add a struct to the cache. It simple uses bincode to serialize the struct and add it to the cache as a Bytes object. # Arguments
src/lib.rs:115
↓ 1 callersMethodcreate_node
(&self, key: String, value: Bytes)
src/cache.rs:142
Methodadd_item
Adds an item to the cache. If the item already exists, it updates the value and moves it to the front. If adding the new item exceeds the capacity, it
src/cache.rs:43
Methodget_item
Retrieves an item from the cache by key. If the item exists, it moves it to the front.
src/cache.rs:67
Methodinitialize
Initilizalizes a new LocalCache with the given capacity and ttl. Note that this only initializes the parameters that set the cache capacity and ttl. T
src/lib.rs:61
Methodnew
(capacity: usize, ttl: u64)
src/lib.rs:66
Methodnew
(capacity: usize, ttl_seconds: u64)
src/cache.rs:31
Functiontest_add_and_get_struct
()
src/lib.rs:215
Functiontest_capacity_based_eviction
()
src/lib.rs:144
Functiontest_get_item_updates_order
()
src/lib.rs:165
Functiontest_no_ttl_expiration
()
src/lib.rs:200
Functiontest_thread_local_isolation
()
src/lib.rs:244
Functiontest_ttl_expiration
()
src/lib.rs:185