pub struct DiskCache { /* private fields */ }Implementations§
Source§impl DiskCache
impl DiskCache
Sourcepub fn discover() -> Option<DiskCache>
pub fn discover() -> Option<DiskCache>
$SVA_CACHE, else the XDG cache home. Never under target/: cargo clean would throw
away hours of rendering, and an installed binary has no build directory to write into.
pub fn at(dir: impl Into<PathBuf>) -> DiskCache
pub fn bounded(dir: impl Into<PathBuf>, max_bytes: u64) -> DiskCache
Sourcepub fn storing_everything(self) -> DiskCache
pub fn storing_everything(self) -> DiskCache
The threshold is policy: a caller measuring reuse itself wants every node stored.
Trait Implementations§
Source§impl Cache for DiskCache
impl Cache for DiskCache
Source§fn held_bytes(&self) -> u64
fn held_bytes(&self) -> u64
A render that reuses nothing and evicted a lot has outgrown its budget, and nothing else in the report says so.
Source§fn worth_storing(&self, cost: Duration, bytes: usize, kind: PayloadKind) -> bool
fn worth_storing(&self, cost: Duration, bytes: usize, kind: PayloadKind) -> bool
Only samples have an encoding here; neither other payload is offered a file.
Source§fn store(
&self,
key: Hash,
payload: &Payload,
traces: &[FilterTrace],
label: Option<&Label>,
)
fn store( &self, key: Hash, payload: &Payload, traces: &[FilterTrace], label: Option<&Label>, )
Renamed into place: a racing reader sees one whole entry or the other.
fn dir(&self) -> Option<&Path>
fn max_bytes(&self) -> u64
fn evicted_bytes(&self) -> u64
fn faults(&self) -> u64
fn holds(&self, key: Hash) -> bool
fn load(&self, key: Hash, node: &str, expected: Expected) -> Option<Entry>
Auto Trait Implementations§
impl !Freeze for DiskCache
impl RefUnwindSafe for DiskCache
impl Send for DiskCache
impl Sync for DiskCache
impl Unpin for DiskCache
impl UnsafeUnpin for DiskCache
impl UnwindSafe for DiskCache
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