Skip to main content

SqlitePack

Struct SqlitePack 

Source
pub struct SqlitePack { /* private fields */ }

Implementations§

Source§

impl SqlitePack

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self>

Source

pub fn open_with_journal( path: impl AsRef<Path>, journal_mode: SqlitePackJournalMode, ) -> Result<Self>

Source

pub fn open_readonly(path: impl AsRef<Path>) -> Result<Self>

Source

pub fn path(&self) -> &Path

Source

pub fn close(self) -> Result<()>

Source

pub fn transaction<T>( &mut self, operation: impl FnOnce(&RusqliteStore<'_>) -> Result<T>, ) -> Result<T>

Source

pub fn put_objects_batch(&self, objects: &[ObjectRecord]) -> Result<()>

Source

pub fn put_file_recipe_cache_batch( &self, entries: &[(Hash32, Hash32)], ) -> Result<()>

Source

pub fn put_chunk( &self, hash: Hash32, content: &[u8], codec: Codec, ) -> Result<()>

Source

pub fn put_recipe( &self, hash: Hash32, content: &[u8], codec: Codec, ) -> Result<()>

Source

pub fn existing_hashes(&self, hashes: &[Hash32]) -> Result<HashSet<Hash32>>

Source

pub fn chunk_stored_bytes(&self, hash: &Hash32) -> Result<Option<u64>>

Source

pub fn chunk_sizes(&self) -> Result<Vec<(Hash32, u64)>>

Source

pub fn file_recipe_cache(&self) -> Result<HashMap<Hash32, Hash32>>

Source

pub fn recipe_for_file_hash(&self, hash: &Hash32) -> Result<Option<Hash32>>

Source

pub fn all_objects(&self) -> Result<Vec<VerifiedObject>>

Source

pub fn object_records( &self, offset: u64, limit: usize, ) -> Result<Vec<ObjectRecord>>

Source

pub fn rebuild_merkle_index(&self) -> Result<MerkleSummary>

Source

pub fn merkle_summary(&self) -> Result<MerkleSummary>

Source

pub fn recompute_merkle_summary(&self) -> Result<MerkleSummary>

Source

pub fn prove_membership(&self, hash: &Hash32) -> Result<Option<MerkleProof>>

Source

pub fn prove_memberships_batch( &self, hashes: &[Hash32], ) -> Result<Vec<Option<MerkleProof>>>

Source

pub fn verify_proof( target: &Hash32, proof: &MerkleProof, expected_root: &Hash32, leaf_count: u64, ) -> bool

Source

pub fn integrity_check(&self) -> Result<()>

Source

pub fn verified_object_hashes(&self) -> Result<Vec<Hash32>>

Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.