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.

Marks the cached file name as newly used, if it exists. Fails with ErrorKind::InvalidInput if name is invalid (empty, or starts with a dot or a forward or back slash).

Returns whether name exists.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.