Struct FileBlobStore

Source
pub struct FileBlobStore {}

Trait Implementations§

Source§

impl BlobStore for FileBlobStore

Source§

fn count(&self) -> Result<BlobID>

Returns the number of blobs in this store.
Source§

fn contains_hash(&self, _blob_hash: BlobHash) -> Result<bool>

Determines if the store contains a blob with the given BLAKE3 hash.
Source§

fn get_by_hash(&self, _blob_hash: BlobHash) -> Result<Option<Blob>>

Fetches a blob by its BLAKE3 hash.
Source§

fn put(&mut self, _blob_data: &mut dyn Read) -> Result<(bool, Blob)>

Stores a blob and returns its metadata.
Source§

fn remove(&mut self, _blob_hash: BlobHash) -> Result<bool>

Removes a blob by its BLAKE3 hash.
Source§

impl BlobStoreExt for FileBlobStore

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 Default for FileBlobStore

Source§

fn default() -> FileBlobStore

Returns the “default value” for a type. Read more
Source§

impl IndexedBlobStore for FileBlobStore

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.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T