1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! A cache manages keys and associated data, and might use a storage to store that data.
//!
//! This module defines the `Cache` trait and provides implementations of it in its submodules.
use crateIoPathResult;
use crateClose;
use ;
/// A cache manages keys and associated data.
///
/// Data can be stored under one or more keys, and retrieved by any of those keys.
/// If a key is reused, the data will be overwritten for that key.
///
/// For reading and writing data, [Cache::Reader] and [Cache::Writer] are returned, respectively.
/// This allows interacting with the data without loading the full content into memory.
/// However, as a written data must become available atomically, the `Writer` must implement
/// [Close] to finalize the write operation.
/// Returned on a successful cache get operation.