pub struct Cache { /* private fields */ }Expand description
Every value a render computed and chose to keep, under its content hash. A hit is the value the cold run wrote, so what is kept or evicted decides only what is computed again. A clone is a handle on the same store, which a stream holds for as long as it plays.
Implementations§
Source§impl Cache
impl Cache
pub fn new() -> Cache
pub fn holding(max_bytes: u64) -> Cache
pub fn max_bytes(&self) -> u64
pub fn set_max_bytes(&self, max_bytes: u64)
Sourcepub fn policy(&self) -> CachePolicy
pub fn policy(&self) -> CachePolicy
What a render stores where it names no policy of its own.
pub fn set_policy(&self, policy: CachePolicy)
pub fn prune_policy(&self) -> PrunePolicy
pub fn set_prune_policy(&self, policy: PrunePolicy)
Sourcepub fn prune(&self, policy: PrunePolicy)
pub fn prune(&self, policy: PrunePolicy)
Evicts every entry policy names, and more where the cap still needs it.
pub fn clear(&self)
pub fn bytes(&self) -> u64
pub fn entries(&self) -> usize
pub fn evictions(&self) -> u64
pub fn holds(&self, key: Hash) -> bool
Sourcepub fn mark_every(&self) -> usize
pub fn mark_every(&self) -> usize
How many samples apart a run keeps the states it passes.
pub fn set_mark_every(&self, samples: usize)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cache
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnsafeUnpin for Cache
impl UnwindSafe for Cache
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