Expand description
The client cache budget driven by the connection class (SSoT: design/filesystem/client § Automatic cache management, and design/networking § Connection Classes).
Three pieces, each with one job:
ConnectionClassSource— the port a client samples its currentConnectionClassthrough.InMemoryConnectionClassis the deterministic adapter tests (and any caller that learns the class out of band, such as a mobile shell pushing OS callbacks) set by hand;DesktopConnectionClassis the desktop adapter, which classifies whateverPathSignalsits probe can read and reportsunmeteredwhen it can tell nothing.plan_for— the pure policy: a class and the user’s base budget in, aCachePlan(the retention byte budget plus whether bulk transfers defer) out.CacheBudget— the orchestration that samples the port, re-plans when the class changes mid-session, and hands the planned budget to the eviction sweep (capsule_library::library::cache_sweep). The sweep is passed in as a closure so this module names no storage type; the sweep alone decides what is evictable, so pinned representations and device-owned originals survive every re-plan.
Structs§
- Cache
Budget - Keeps the cache within the budget the current connection class allows.
- Cache
Plan - What the client does with its cache and bulk transfers on one connection class.
- Cache
Sweep Outcome - What one
CacheBudget::sweepdid. - Desktop
Connection Class - The desktop class source. Desktop operating systems expose no portable metered or data-saver
signal, so the default probe reads nothing and the source reports
ConnectionClass::Unmetered: a wired or Wi-Fi desktop is the networking table’s “OS reports not expensive / not metered” case. A platform that can read real signals installs a probe withwith_probe, and whatever it reports is classified byConnectionClass::from_signals. - InMemory
Connection Class - A deterministic, settable class source. Tests drive class changes through it; a platform shell that is told the class by OS callbacks can push them through it as well.
Constants§
- DEFAULT_
BASE_ CACHE_ BUDGET - The default base cache budget, 2 GiB: the reclaimable bytes an unmetered client retains
before the sweep evicts. The user setting overrides it; other classes scale it through
ConnectionClass::cache_retention_budget.
Traits§
- Connection
Class Source - The port a client samples its current connection class through.
Functions§
- plan_
for - The cache plan for
classfrom the user’sbase_budget_bytes. Pure.
Type Aliases§
- Path
Probe - Reads the OS path signals on desktop, or
Nonewhen the OS exposes nothing usable.