pub struct FsStore { /* private fields */ }Expand description
Second implementation (seam rule): filesystem store, one file per chunk, sharded by the first digest byte.
Implementations§
Source§impl FsStore
impl FsStore
Sourcepub fn open(root: &Path) -> Result<Self, StoreError>
pub fn open(root: &Path) -> Result<Self, StoreError>
Opens (creating if absent) a store rooted at root.
§Errors
Returns StoreError::Io when the root cannot be created.
Trait Implementations§
Source§impl ChunkStore for FsStore
impl ChunkStore for FsStore
Source§fn put(&mut self, data: &[u8]) -> Result<ContentHash, StoreError>
fn put(&mut self, data: &[u8]) -> Result<ContentHash, StoreError>
Stores
data and returns its content address. Idempotent.Source§fn get(&self, hash: &ContentHash) -> Result<Vec<u8>, StoreError>
fn get(&self, hash: &ContentHash) -> Result<Vec<u8>, StoreError>
Retrieves the bytes for
hash, verifying them against the address.Source§fn has(&self, hash: &ContentHash) -> bool
fn has(&self, hash: &ContentHash) -> bool
Whether
hash is present.Auto Trait Implementations§
impl Freeze for FsStore
impl RefUnwindSafe for FsStore
impl Send for FsStore
impl Sync for FsStore
impl Unpin for FsStore
impl UnsafeUnpin for FsStore
impl UnwindSafe for FsStore
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