Skip to main content

BitmapIndex

Struct BitmapIndex 

Source
pub struct BitmapIndex { /* private fields */ }
Expand description

Memory-mapped pack or MIDX reachability bitmap (Git BITM v1).

Implementations§

Source§

impl BitmapIndex

Source

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.

Source

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

Source

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.

Source

pub fn commit_bitmap( &self, commit: &ObjectId, ) -> Option<CommitReachabilityBitmap>

Reachability bitmap for commit, when that commit is indexed.

Source

pub fn type_bitmap(&self, kind: ObjectKind) -> TypeBitmap<'_>

Type filter bitmap for kind (commits, trees, blobs, or tags).

Source

pub fn name_hash(&self, position: u32) -> Option<u32>

Name-hash cache entry for bitmap position position, when present.

Source

pub fn object_count(&self) -> u32

Number of objects in the pack/MIDX namespace (length of type bitmaps).

Source

pub fn has_lookup_table(&self) -> bool

Whether the on-disk index included a commit lookup table extension.

Source

pub fn selected_commit_count(&self) -> u32

Number of reachability bitmap entries (selected commits) in this file.

Source

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.

Source

pub fn position_of(&self, oid: &ObjectId) -> Option<u32>

Bitmap bit position for oid, when the object is in this index.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.