Struct kismet_cache::sharded::Cache [−][src]
pub struct Cache { /* fields omitted */ }Expand description
A sharded cache is a hash-sharded directory of cache subdirectories. Each subdirectory is managed as an independent second chance cache directory.
Implementations
Returns a new cache for approximately total_capacity files,
stores in num_shards subdirectories of base_dir.
Returns a read-only file for key in the shard cache
directory if it exists, or None if there is no such file.
Fails with ErrorKind::InvalidInput if key.name is invalid
(empty, or starts with a dot or a forward or back slash).
Implicitly “touches” the cached file if it exists.
Returns a temporary directory suitable for temporary files that will be published to the shard cache directory.
When this temporary file will be published at a known Key,
populate key for improved behaviour.
Inserts or overwrites the file at value as key in the
sharded cache directory. There may be two entries for the
same key with concurrent set or put calls. Fails with
ErrorKind::InvalidInput if key.name is invalid (empty, or
starts with a dot or a forward or back slash).
Always consumes the file at value on success; may consume it
on error.
Inserts the file at value as key in the cache directory if
there is no such cached entry already, or touches the cached
file if it already exists. There may be two entries for the
same key with concurrent set or put calls. Fails with
ErrorKind::InvalidInput if key.name is invalid (empty, or
starts with a dot or a forward or back slash).
Always consumes the file at value on success; may consume it
on error.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Cache
impl UnwindSafe for Cache
Blanket Implementations
Mutably borrows from an owned value. Read more