Struct kismet_cache::plain::Cache [−][src]
pub struct Cache { /* fields omitted */ }Expand description
A “plain” cache is a single directory of files. Given a capacity
of k files, we will trigger a second chance maintance roughly
every k / 3 (k / 6 in the long run, given the way
PeriodicTrigger is implemented) insertions.
Implementations
Returns a new cache for approximately capacity files in
base_dir.
Returns a read-only file for name in the cache directory if
it exists, or None if there is no such file. Fails with
ErrorKind::InvalidInput if name is invalid (empty, or
starts with a dot or a forward or back slash).
Implicitly “touches” the cached file name if it exists.
Returns a temporary directory suitable for temporary files that will be published to the cache directory.
Inserts or overwrites the file at value as name in the
cache directory. Fails with ErrorKind::InvalidInput if
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 name in the cache directory
if there is no such cached entry already, or touches the
cached file if it already exists. Fails with
ErrorKind::InvalidInput if 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