pub struct PackManager { /* private fields */ }Implementations§
Source§impl PackManager
impl PackManager
pub fn new(packs_dir: PathBuf) -> Self
pub fn reload(&mut self) -> Result<()>
pub fn get_object( &self, id: &PackObjectId, ) -> Result<Option<(ObjectType, Vec<u8>)>>
pub fn get_hashed_object( &self, hash: &ContentHash, ) -> Result<Option<(ObjectType, Vec<u8>)>>
pub fn has_object(&self, hash: &ContentHash) -> bool
Sourcepub fn get_hashed_object_size(&self, hash: &ContentHash) -> Result<Option<u64>>
pub fn get_hashed_object_size(&self, hash: &ContentHash) -> Result<Option<u64>>
Look up the uncompressed size of hash across all loaded
packs without decompressing the payload. Returns Ok(None)
when the object isn’t in any loaded pack.
pub fn has_object_id(&self, id: &PackObjectId) -> bool
Sourcepub fn list_all_hashes(&self) -> Result<Vec<ContentHash>>
pub fn list_all_hashes(&self) -> Result<Vec<ContentHash>>
List all object hashes across all packs.
pub fn list_all_ids(&self) -> Result<Vec<PackObjectId>>
Sourcepub fn pack_file_paths(&self) -> Vec<(&Path, &Path)>
pub fn pack_file_paths(&self) -> Vec<(&Path, &Path)>
Return paths of all pack files (for deletion during aggressive repack).
pub fn pack_count(&self) -> usize
pub fn packs_dir(&self) -> &Path
Auto Trait Implementations§
impl Freeze for PackManager
impl RefUnwindSafe for PackManager
impl Send for PackManager
impl Sync for PackManager
impl Unpin for PackManager
impl UnsafeUnpin for PackManager
impl UnwindSafe for PackManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more