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
55
56
57
58
59
60
61
62
63
use MemUsageTree;
use ChunkStoreEvent;
use EntityDb;
/// A cache for memoizing things in order to speed up immediate mode UI & other immediate mode style things.
///
/// Caches are stored in [`crate::Memoizers`], and each [`crate::Memoizers`] instance belongs to a
/// single [`re_log_types::StoreId`]. This means cache implementations are already scoped to one
/// store (recording or blueprint) and must not include the store id in their internal keys.
///
/// Cache implementations may still need finer-grained keys, such as [`crate::ViewId`], entity paths,
/// timelines, or query ranges. In particular, view-related caches should explicitly decide whether
/// their data is truly per-view (`ViewId` key needed) or can be shared across all views of the same
/// store (`ViewId` key not needed).
///
/// See also egus's cache system, in [`egui::cache`] (<https://docs.rs/egui/latest/egui/cache/index.html>).
/// Trait for [`Cache`]es that are internally a list of key-value pairs that are computed once
/// and can be trivially returned without holding the lock.
///
/// Implementing this is required for [`crate::Memoizers::read_or_compute`].