pub struct LocalCas { /* private fields */ }Expand description
A validated, content-addressed store on the local filesystem.
Implementations§
Source§impl LocalCas
impl LocalCas
Sourcepub fn new(root: impl Into<PathBuf>) -> Self
pub fn new(root: impl Into<PathBuf>) -> Self
Create a local content-addressed store beneath root.
Sourcepub fn path_for(&self, digest: &CacheDigest) -> Result<PathBuf>
pub fn path_for(&self, digest: &CacheDigest) -> Result<PathBuf>
Resolve the storage path for a validated digest.
Sourcepub fn find(&self, digest: &CacheDigest) -> Result<Option<PathBuf>>
pub fn find(&self, digest: &CacheDigest) -> Result<Option<PathBuf>>
Find and verify a stored object.
Sourcepub fn store_bytes(&self, digest: &CacheDigest, bytes: &[u8]) -> Result<PathBuf>
pub fn store_bytes(&self, digest: &CacheDigest, bytes: &[u8]) -> Result<PathBuf>
Atomically store bytes after verifying their declared digest.
Sourcepub fn store_file(&self, digest: &CacheDigest, source: &Path) -> Result<PathBuf>
pub fn store_file(&self, digest: &CacheDigest, source: &Path) -> Result<PathBuf>
Atomically store a file after verifying its declared digest.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LocalCas
impl RefUnwindSafe for LocalCas
impl Send for LocalCas
impl Sync for LocalCas
impl Unpin for LocalCas
impl UnsafeUnpin for LocalCas
impl UnwindSafe for LocalCas
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