Skip to main content

PackedObjects

Struct PackedObjects 

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

Pack-index-backed read-only ObjectStore for one objects/ directory.

Implementations§

Source§

impl PackedObjects

Source

pub fn new(store: Arc<PackStore>) -> Self

Open pack reads for store’s objects/ directory.

Source

pub fn pack_store(&self) -> &Arc<PackStore> ⓘ

Shared pack cache handle (same as used for reads).

Source

pub fn object_ids_from_index_path(idx_path: &Path) -> Result<HashSet<ObjectId>>

Object ids listed in a pack index file (for ingest paths outside the live ODB cache).

§Errors

Propagates pack index parse/verify failures from pack::read_pack_index.

Source

pub fn contains_filtered( &self, oid: &ObjectId, filter: PackFilter, ) -> Result<bool>

Whether oid appears in any pack index matching filter.

Used for local materialization checks (promisor/cruft exclusion); not part of ObjectStore::contains, which ignores promisor packs.

§Errors

Propagates pack directory enumeration failures.

Source

pub fn for_each_promisor_object( &self, f: &mut dyn FnMut(&ObjectId) -> ControlFlow<()>, ) -> Result<()>

Invoke f for each object id stored in a promisor-marked pack index.

§Errors

Propagates pack index enumeration failures.

Source

pub fn kept_pack_object_ids(&self) -> Result<HashSet<ObjectId>>

Collect object ids from pack indexes that have a sibling .keep file.

§Errors

Propagates pack directory or index read failures.

Source

pub fn for_each_removable_pack_object( &self, f: &mut dyn FnMut(&ObjectId) -> ControlFlow<()>, ) -> Result<()>

Invoke f for each object id in a local pack index without a sibling .keep or .promisor file.

Used by repack when retaining unreachable storage from packs that will be removed.

§Errors

Propagates pack index enumeration failures.

Source

pub fn freshen_pack_containing(&self, oid: &ObjectId) -> Result<bool>

Touch the mtime of the pack file holding oid (Git pack freshen), when not cruft.

§Errors

Propagates I/O failures from pack listing or utime.

Trait Implementations§

Source§

impl Debug for PackedObjects

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ObjectStore for PackedObjects

Source§

fn hash_algo(&self) -> HashAlgo

Hash algorithm for objects written through this store.
Source§

fn read(&self, oid: &ObjectId) -> Result<Option<Object>>

Load the full object, if present. Read more
Source§

fn read_into( &self, oid: &ObjectId, buf: &mut Vec<u8>, ) -> Result<Option<ObjectKind>>

Load object payload into buf, reusing its capacity when possible. Read more
Source§

fn read_info(&self, oid: &ObjectId) -> Result<Option<ObjectInfo>>

Object kind and size without loading the full payload. Read more
Source§

fn open_stream(&self, oid: &ObjectId) -> Result<Option<ObjectStream<'_>>>

Open a stream over the object’s uncompressed payload. Read more
Source§

fn for_each_object( &self, f: &mut dyn FnMut(&ObjectId) -> ControlFlow<()>, ) -> Result<()>

Invoke f for every object id in this store until f returns ControlFlow::Break. Read more
Source§

fn lookup_prefix( &self, prefix: &str, limit: usize, out: &mut Vec<ObjectId>, ) -> Result<()>

Fill out with object ids whose hex form starts with prefix (case-insensitive). Read more
Source§

fn refresh(&self) -> Result<bool>

Reload indexes or caches after on-disk changes (packs, alternates, MIDX). Read more
Source§

fn contains(&self, oid: &ObjectId) -> Result<bool>

Whether oid is stored in this backend (without reading the payload). Read more
Source§

fn contains_many(&self, oids: &[ObjectId]) -> Result<Vec<bool>>

For each id in oids, whether it is stored in this backend; the result has one entry per input id, in input order. Read more

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.