pub struct PackStore { /* private fields */ }Expand description
Per-objects/ cache of pack indexes, bytes, MIDX views, and delta-base LRU state.
crate::odb::Odb owns an Arc<PackStore>; Odb clones share it.
Independently opened Odb handles for the same path get separate stores.
Alternate object directories get separate stores retained on the parent Odb.
Implementations§
Source§impl PackStore
impl PackStore
Sourcepub fn new(objects_dir: PathBuf) -> Self
pub fn new(objects_dir: PathBuf) -> Self
Create a fresh store for objects_dir (not shared with other independent Odb opens).
Sourcepub fn objects_dir(&self) -> &Path
pub fn objects_dir(&self) -> &Path
objects/ path for this store.
Sourcepub fn has_context() -> bool
pub fn has_context() -> bool
Whether this thread already has an active pack-read store context.
Sourcepub fn with_context<R>(store: Arc<Self>, f: impl FnOnce() -> R) -> R
pub fn with_context<R>(store: Arc<Self>, f: impl FnOnce() -> R) -> R
Run f with store as the pack-read context on this thread.
Sourcepub fn invalidate_packs(&self)
pub fn invalidate_packs(&self)
Drop cached pack listings, indexes, pack bytes, and delta bases.
Sourcepub fn invalidate_midx(&self)
pub fn invalidate_midx(&self)
Drop MIDX bytes and tip cache under this store’s objects/pack/.
Sourcepub fn invalidate_all(&self)
pub fn invalidate_all(&self)
Full pack + MIDX invalidation (after repack/gc/index-pack in-process).
Sourcepub fn configure_delta_base_from_config(&self, cfg: Option<&ConfigSet>)
pub fn configure_delta_base_from_config(&self, cfg: Option<&ConfigSet>)
Apply core.deltaBaseCacheLimit from config to this store’s delta-base LRU.
Sourcepub fn invalidate_all_legacy()
pub fn invalidate_all_legacy()
Clear legacy thread-local stores (tests/benches calling crate::pack::clear_pack_cache).