pub struct FrameCache<Value, Computer> { /* private fields */ }
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.
Implementations§
Source§impl<Value, Computer> FrameCache<Value, Computer>
impl<Value, Computer> FrameCache<Value, Computer>
pub fn new(computer: Computer) -> Self
Sourcepub fn evice_cache(&mut self)
pub fn evice_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