Struct lru_disk_cache::LruDiskCache [] [src]

pub struct LruDiskCache<S: BuildHasher = RandomState> { /* fields omitted */ }

An LRU cache of files on disk.

Methods

impl LruDiskCache
[src]

[src]

Create an LruDiskCache that stores files in path, limited to size bytes.

Existing files in path will be stored with their last-modified time from the filesystem used as the order for the recency of their use. Any files that are individually larger than size bytes will be removed.

The cache is not observant of changes to files under path from external sources, it expects to have sole maintence of the contents.

[src]

Return the current size of all the files in the cache.

[src]

Return the maximum size of the cache.

[src]

Return the path in which the cache is stored.

[src]

Returns true if the disk cache can store a file of size bytes.

[src]

Add a file with bytes as its contents to the cache at path key.

[src]

Add an existing file at path to the cache at path key.

[src]

Return true if a file with path key is in the cache.

[src]

Get an opened readable and seekable handle to the file at key, if one exists and can be opened. Updates the LRU state of the file if present.