pub struct FsBlobStore { /* private fields */ }Expand description
On-disk content-addressed store, sharded by digest prefix.
Layout (rooted at <root>/blobs/sha256/):
blobs/sha256/
ab/
ab12cd34…ff.zst (zstd-19 compressed payload)
cd/
cd56ef78…00.zstThe two-byte shard prefix keeps directory entry counts <65 536 even at
large stores. Atomic write is temp file in same dir → fsync → rename.
Thread-safe (concurrent put/get ok). On a race two writers may both
produce the same temp file path — we add a per-process counter to dodge.
Implementations§
Trait Implementations§
Source§impl BlobStore for FsBlobStore
impl BlobStore for FsBlobStore
Source§fn put(&self, bytes: &[u8]) -> Result<Digest256>
fn put(&self, bytes: &[u8]) -> Result<Digest256>
Insert
bytes, return its content digest. Idempotent: storing the
same payload twice produces the same digest and is a no-op the second
time.Source§fn get(&self, digest: &Digest256) -> Result<Vec<u8>>
fn get(&self, digest: &Digest256) -> Result<Vec<u8>>
Retrieve the bytes for a previously-stored digest.
Source§fn physical_bytes(&self) -> Result<u64>
fn physical_bytes(&self) -> Result<u64>
Total physical bytes stored on disk (compressed). Implementations may
approximate; used for
pf status and the storage-efficiency
microbenchmark.Auto Trait Implementations§
impl !Freeze for FsBlobStore
impl !RefUnwindSafe for FsBlobStore
impl Send for FsBlobStore
impl Sync for FsBlobStore
impl Unpin for FsBlobStore
impl UnsafeUnpin for FsBlobStore
impl UnwindSafe for FsBlobStore
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