Struct egui::cache::frame_cache::FrameCache
source · pub struct FrameCache<Value, Computer> {
generation: u32,
computer: Computer,
cache: IntMap<u64, (u32, Value)>,
}
Expand description
Caches the results of a computation for one frame. If it is still used next frame, it is not recomputed. If it is not used next frame, it is evicted from the cache to save memory.
Fields§
§generation: u32
§computer: Computer
§cache: IntMap<u64, (u32, Value)>
Implementations§
source§impl<Value, Computer> FrameCache<Value, Computer>
impl<Value, Computer> FrameCache<Value, Computer>
pub fn new(computer: Computer) -> Self
sourcepub fn evict_cache(&mut self)
pub fn evict_cache(&mut self)
Must be called once per frame to clear the cache.
source§impl<Value, Computer> FrameCache<Value, Computer>
impl<Value, Computer> FrameCache<Value, Computer>
Trait Implementations§
source§impl<Value: 'static + Send + Sync, Computer: 'static + Send + Sync> CacheTrait for FrameCache<Value, Computer>
impl<Value: 'static + Send + Sync, Computer: 'static + Send + Sync> CacheTrait for FrameCache<Value, Computer>
Auto Trait Implementations§
impl<Value, Computer> Freeze for FrameCache<Value, Computer>where
Computer: Freeze,
impl<Value, Computer> RefUnwindSafe for FrameCache<Value, Computer>where
Computer: RefUnwindSafe,
Value: RefUnwindSafe,
impl<Value, Computer> Send for FrameCache<Value, Computer>
impl<Value, Computer> Sync for FrameCache<Value, Computer>
impl<Value, Computer> Unpin for FrameCache<Value, Computer>
impl<Value, Computer> UnwindSafe for FrameCache<Value, Computer>where
Computer: UnwindSafe,
Value: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more