pub struct GitBlobStore<'r> { /* private fields */ }Expand description
Git-backed implementation of BlobReader and BlobWriter.
Stores blobs as single-file Git commits on refs derived from the
logical path. For example, the path "identities/abc123/metadata"
maps to the ref refs/auths/blobs/identities/abc123/metadata.
Usage:
ⓘ
use auths_infra_git::{GitRepo, GitBlobStore};
use auths_core::ports::storage::BlobReader;
let repo = GitRepo::open("/path/to/repo")?;
let store = GitBlobStore::new(&repo);
let data = store.get_blob("identities/abc123/metadata")?;Implementations§
Trait Implementations§
Source§impl BlobReader for GitBlobStore<'_>
impl BlobReader for GitBlobStore<'_>
Source§fn get_blob(&self, path: &str) -> Result<Vec<u8>, StorageError>
fn get_blob(&self, path: &str) -> Result<Vec<u8>, StorageError>
Returns the raw bytes stored at the given logical path. Read more
Source§fn list_blobs(&self, prefix: &str) -> Result<Vec<String>, StorageError>
fn list_blobs(&self, prefix: &str) -> Result<Vec<String>, StorageError>
Lists all blob paths under the given prefix. Read more
Source§fn blob_exists(&self, path: &str) -> Result<bool, StorageError>
fn blob_exists(&self, path: &str) -> Result<bool, StorageError>
Checks whether a blob exists at the given logical path. Read more
Source§impl BlobWriter for GitBlobStore<'_>
impl BlobWriter for GitBlobStore<'_>
Auto Trait Implementations§
impl<'r> Freeze for GitBlobStore<'r>
impl<'r> RefUnwindSafe for GitBlobStore<'r>
impl<'r> Send for GitBlobStore<'r>
impl<'r> Sync for GitBlobStore<'r>
impl<'r> Unpin for GitBlobStore<'r>
impl<'r> UnsafeUnpin for GitBlobStore<'r>
impl<'r> UnwindSafe for GitBlobStore<'r>
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