Trait rerun::external::re_viewer_context::Cache
source · pub trait Cache: Any + Send + Sync {
// Required methods
fn purge_memory(&mut self);
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static);
// 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§
sourcefn purge_memory(&mut self)
fn purge_memory(&mut self)
Attempt to free up memory.
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts itself to a mutable reference of Any
, which enables mutable downcasting to concrete types.
Provided Methods§
sourcefn begin_frame(&mut self, _renderer_active_frame_idx: u64)
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
.
sourcefn on_store_events(&mut self, events: &[ChunkStoreEvent])
fn on_store_events(&mut self, events: &[ChunkStoreEvent])
React to the chunk store’s changelog, if needed.
Useful to e.g. invalidate unreachable data.