pub struct MidxObjects { /* private fields */ }Expand description
MIDX-backed read-only ObjectStore for one objects/ directory.
Preparation and payload reads use the supplied PackStore, including calls
made outside an explicit pack-read context. Strict and permissive MIDX views
in that store share validated layer mappings. Checksums are checked once per
layer with bounded residency; lookup pages are faulted in as needed.
Independently opened stores keep independent snapshots. Call
ObjectStore::refresh after replacing MIDX or pack files externally.
Implementations§
Source§impl MidxObjects
impl MidxObjects
Sourcepub fn new(store: Arc<PackStore>, multi_pack_index: bool) -> Result<Self>
pub fn new(store: Arc<PackStore>, multi_pack_index: bool) -> Result<Self>
Open MIDX reads for store’s objects/ directory.
multi_pack_index mirrors core.multiPackIndex at construction time; the store does not
read config itself.
§Errors
Propagates MIDX chain preparation failures other than a missing or skipped index.
Sourcepub fn status(&self) -> MidxObjectsStatus
pub fn status(&self) -> MidxObjectsStatus
Whether MIDX-backed reads are active for this store.
Sourcepub fn multi_pack_index_enabled(&self) -> bool
pub fn multi_pack_index_enabled(&self) -> bool
Whether core.multiPackIndex was enabled when this store was built.
Sourcepub fn covered_pack_basenames(&self) -> Result<HashSet<String>>
pub fn covered_pack_basenames(&self) -> Result<HashSet<String>>
Pack index basenames covered by the active MIDX chain (empty when inactive).
Callers skip these indexes in PackedObjects so MIDX-covered OIDs are not scanned twice.
§Errors
Propagates MIDX chain load failures.
Sourcepub fn packed_objects(&self) -> &PackedObjects
pub fn packed_objects(&self) -> &PackedObjects
Underlying pack backend used for object payload reads.
Trait Implementations§
Source§impl Debug for MidxObjects
impl Debug for MidxObjects
Source§impl ObjectStore for MidxObjects
impl ObjectStore for MidxObjects
Source§fn read(&self, oid: &ObjectId) -> Result<Option<Object>>
fn read(&self, oid: &ObjectId) -> Result<Option<Object>>
Source§fn read_info(&self, oid: &ObjectId) -> Result<Option<ObjectInfo>>
fn read_info(&self, oid: &ObjectId) -> Result<Option<ObjectInfo>>
Source§fn open_stream(&self, oid: &ObjectId) -> Result<Option<ObjectStream<'_>>>
fn open_stream(&self, oid: &ObjectId) -> Result<Option<ObjectStream<'_>>>
Source§fn for_each_object(
&self,
f: &mut dyn FnMut(&ObjectId) -> ControlFlow<()>,
) -> Result<()>
fn for_each_object( &self, f: &mut dyn FnMut(&ObjectId) -> ControlFlow<()>, ) -> Result<()>
Source§fn lookup_prefix(
&self,
prefix: &str,
limit: usize,
out: &mut Vec<ObjectId>,
) -> Result<()>
fn lookup_prefix( &self, prefix: &str, limit: usize, out: &mut Vec<ObjectId>, ) -> Result<()>
Source§fn refresh(&self) -> Result<bool>
fn refresh(&self) -> Result<bool>
Source§fn read_into(
&self,
oid: &ObjectId,
buf: &mut Vec<u8>,
) -> Result<Option<ObjectKind>>
fn read_into( &self, oid: &ObjectId, buf: &mut Vec<u8>, ) -> Result<Option<ObjectKind>>
buf, reusing its capacity when possible. Read more