pub struct BitmapIndex { /* private fields */ }Expand description
Memory-mapped pack or MIDX reachability bitmap (Git BITM v1).
Implementations§
Source§impl BitmapIndex
impl BitmapIndex
Sourcepub fn reachability(
self: &Arc<Self>,
repo: &Repository,
query: ReachabilityQuery<'_>,
missing: MissingAction,
) -> Result<ReachableSet, BitmapWalkError>
pub fn reachability( self: &Arc<Self>, repo: &Repository, query: ReachabilityQuery<'_>, missing: MissingAction, ) -> Result<ReachableSet, BitmapWalkError>
Run query against this index and repo.
§Errors
Returns BitmapWalkError::Unsupported for shallow repositories or unsupported filters.
Sourcepub fn verify_commit(
self: &Arc<Self>,
repo: &Repository,
commit: &ObjectId,
missing: MissingAction,
) -> Result<bool, BitmapWalkError>
pub fn verify_commit( self: &Arc<Self>, repo: &Repository, commit: &ObjectId, missing: MissingAction, ) -> Result<bool, BitmapWalkError>
Compare the on-disk commit bitmap for commit with a fresh non-bitmap walk (rev-list --test-bitmap).
Returns Ok(true) when they match, Ok(false) when the commit has no stored bitmap or the
bitmap differs, and propagates read/decode errors.
§Errors
Propagates object read failures according to missing.
Source§impl BitmapIndex
impl BitmapIndex
Sourcepub fn open(repo: &Repository) -> Result<Option<Arc<Self>>, BitmapError>
pub fn open(repo: &Repository) -> Result<Option<Arc<Self>>, BitmapError>
Open the active reachability bitmap for repo, preferring MIDX over pack bitmaps.
Returns Ok(None) when no usable bitmap exists, the primary store is not
files-backed, or the on-disk file failed validation (a warning is emitted).
§Errors
Propagates unexpected I/O failures while discovering bitmap paths.
Sourcepub fn commit_bitmap(
&self,
commit: &ObjectId,
) -> Option<CommitReachabilityBitmap>
pub fn commit_bitmap( &self, commit: &ObjectId, ) -> Option<CommitReachabilityBitmap>
Reachability bitmap for commit, when that commit is indexed.
Sourcepub fn type_bitmap(&self, kind: ObjectKind) -> TypeBitmap<'_>
pub fn type_bitmap(&self, kind: ObjectKind) -> TypeBitmap<'_>
Type filter bitmap for kind (commits, trees, blobs, or tags).
Sourcepub fn name_hash(&self, position: u32) -> Option<u32>
pub fn name_hash(&self, position: u32) -> Option<u32>
Name-hash cache entry for bitmap position position, when present.
Sourcepub fn object_count(&self) -> u32
pub fn object_count(&self) -> u32
Number of objects in the pack/MIDX namespace (length of type bitmaps).
Sourcepub fn has_lookup_table(&self) -> bool
pub fn has_lookup_table(&self) -> bool
Whether the on-disk index included a commit lookup table extension.
Sourcepub fn selected_commit_count(&self) -> u32
pub fn selected_commit_count(&self) -> u32
Number of reachability bitmap entries (selected commits) in this file.
Sourcepub fn oid_at(&self, position: u32) -> Result<ObjectId, BitmapError>
pub fn oid_at(&self, position: u32) -> Result<ObjectId, BitmapError>
Object id at bitmap bit position.
§Errors
Returns BitmapError::Corrupt when position is out of range.
Sourcepub fn position_of(&self, oid: &ObjectId) -> Option<u32>
pub fn position_of(&self, oid: &ObjectId) -> Option<u32>
Bitmap bit position for oid, when the object is in this index.