Trait re_viewer_context::cache::caches::Cache

source ·
pub trait Cache: Any + Send + Sync {
    // Required methods
    fn purge_memory(&mut self);
    fn as_any_mut(&mut self) -> &mut dyn Any;

    // Provided methods
    fn begin_frame(&mut self, _renderer_active_frame_idx: u64) { ... }
    fn on_store_events(&mut self, events: &[ChunkStoreEvent]) { ... }
}
Expand description

A cache for memoizing things in order to speed up immediate mode UI & other immediate mode style things.

Required Methods§

source

fn purge_memory(&mut self)

Attempt to free up memory.

source

fn as_any_mut(&mut self) -> &mut dyn Any

Converts itself to a mutable reference of Any, which enables mutable downcasting to concrete types.

Provided Methods§

source

fn begin_frame(&mut self, _renderer_active_frame_idx: u64)

Called once per frame to potentially flush the cache.

_renderer_active_frame_idx: The global frame index as reported by re_renderer::RenderContext::active_frame_idx.

source

fn on_store_events(&mut self, events: &[ChunkStoreEvent])

React to the chunk store’s changelog, if needed.

Useful to e.g. invalidate unreachable data.

Implementors§