pub struct Pack { /* private fields */ }Implementations§
Source§impl Pack
impl Pack
pub async fn open(path: impl AsRef<Path>) -> Result<Self>
pub async fn open_with_journal( path: impl AsRef<Path>, journal_mode: PackJournalMode, ) -> Result<Self>
pub async fn open_readonly(path: impl AsRef<Path>) -> Result<Self>
pub fn path(&self) -> &Path
pub async fn close(&self)
pub async fn begin_write_tx(&self) -> Result<PackWriteTx<'_>>
pub async fn put_objects_batch_tx( tx: &mut PackWriteTx<'_>, objects: &[ObjectRecord], ) -> Result<()>
pub async fn put_file_recipe_cache_batch_tx( tx: &mut PackWriteTx<'_>, entries: &[(Hash32, Hash32)], ) -> Result<()>
pub async fn put_chunk( &self, hash: Hash32, content: &[u8], codec: Codec, ) -> Result<()>
pub async fn put_recipe( &self, hash: Hash32, content: &[u8], codec: Codec, ) -> Result<()>
pub async fn existing_hashes( &self, hashes: &[Hash32], ) -> Result<HashSet<Hash32>>
pub async fn chunk_stored_bytes(&self, hash: &Hash32) -> Result<Option<u64>>
pub async fn chunk_sizes(&self) -> Result<Vec<(Hash32, u64)>>
pub async fn file_recipe_cache(&self) -> Result<HashMap<Hash32, Hash32>>
pub async fn recipe_for_file_hash( &self, file_hash: &Hash32, ) -> Result<Option<Hash32>>
pub async fn all_objects(&self) -> Result<Vec<VerifiedObject>>
pub fn stream_object_records( &self, ) -> impl Stream<Item = Result<ObjectRecord>> + '_
pub fn stream_object_records_with_batch_size( &self, batch_size: usize, ) -> impl Stream<Item = Result<ObjectRecord>> + '_
pub async fn rebuild_merkle_index(&self) -> Result<MerkleSummary>
pub async fn merkle_summary(&self) -> Result<MerkleSummary>
pub async fn recompute_merkle_summary(&self) -> Result<MerkleSummary>
pub async fn prove_membership( &self, hash: &Hash32, ) -> Result<Option<MerkleProof>>
pub fn verify_proof( target: &Hash32, proof: &MerkleProof, expected_root: &Hash32, leaf_count: u64, ) -> bool
pub async fn integrity_check(&self) -> Result<()>
pub async fn prove_memberships_batch( &self, hashes: &[Hash32], ) -> Result<Vec<Option<MerkleProof>>>
pub async fn verified_object_hashes(&self) -> Result<Vec<Hash32>>
Trait Implementations§
Source§impl ObjectSource for Pack
impl ObjectSource for Pack
async fn read_object(&self, hash: &Hash32) -> Result<Option<VerifiedObject>>
Auto Trait Implementations§
impl !RefUnwindSafe for Pack
impl !UnwindSafe for Pack
impl Freeze for Pack
impl Send for Pack
impl Sync for Pack
impl Unpin for Pack
impl UnsafeUnpin for Pack
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more