Trait IndexedBlobStore

Source
pub trait IndexedBlobStore: BlobStore {
    // Required methods
    fn hash_to_id(&self, blob_hash: BlobHash) -> Result<Option<BlobID>>;
    fn id_to_hash(&self, blob_id: BlobID) -> Result<Option<BlobHash>>;
    fn get_by_id(&self, blob_id: BlobID) -> Result<Option<Blob>>;
}

Required Methods§

Source

fn hash_to_id(&self, blob_hash: BlobHash) -> Result<Option<BlobID>>

Converts a BLAKE3 hash to a store ID.

Source

fn id_to_hash(&self, blob_id: BlobID) -> Result<Option<BlobHash>>

Converts a store ID to a BLAKE3 hash.

Source

fn get_by_id(&self, blob_id: BlobID) -> Result<Option<Blob>>

Fetches a blob by its store ID.

Trait Implementations§

Source§

impl BlobStoreExt for dyn IndexedBlobStore

Source§

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

Determines if the store contains no blobs.
Source§

fn put_bytes(&mut self, data: impl AsRef<[u8]>) -> Result<(bool, Blob)>

Stores a blob and returns its store ID.
Source§

fn put_string(&mut self, data: impl AsRef<str>) -> Result<(bool, Blob)>

Stores a blob and returns its store ID.
Source§

fn put_file(&mut self, path: impl AsRef<Path>) -> Result<(bool, Blob)>

Stores a blob and returns its store ID.
Source§

impl<'a> IntoIterator for &'a mut dyn IndexedBlobStore

Source§

type Item = Blob

The type of the elements being iterated over.
Source§

type IntoIter = IndexedBlobStoreIterator<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Implementors§