egui/cache/mod.rs
1//! Caches for preventing the same value from being recomputed every frame.
2//!
3//! Computing the same thing each frame can be expensive,
4//! so often you want to save the result from the previous frame and reuse it.
5//!
6//! Enter [`FrameCache`]: it caches the results of a computation for one frame.
7//! If it is still used next frame, it is not recomputed.
8//! If it is not used next frame, it is evicted from the cache to save memory.
9//!
10//! You can access egui's caches via [`crate::Memory::caches`],
11//! found with [`crate::Context::memory_mut`].
12
13mod cache_storage;
14mod cache_trait;
15mod frame_cache;
16mod frame_publisher;
17
18pub use cache_storage::CacheStorage;
19pub use cache_trait::CacheTrait;
20pub use frame_cache::{ComputerMut, FrameCache};
21pub use frame_publisher::FramePublisher;