pub trait ObjectStore<ObjectID: FsVerityHashValue>: Send + Sync {
// Required methods
fn ensure_object_from_fd(&self, fd: OwnedFd, size: u64) -> Result<ObjectID>;
fn write_semaphore(&self) -> Arc<Semaphore> ⓘ;
}Expand description
An abstraction over content-addressed storage for file objects.
Both Repository and the C-compatible FlatDigestStore implement
this trait so that read_filesystem can write file content to either
layout without duplicating the scanning logic.
Required Methods§
Sourcefn ensure_object_from_fd(&self, fd: OwnedFd, size: u64) -> Result<ObjectID>
fn ensure_object_from_fd(&self, fd: OwnedFd, size: u64) -> Result<ObjectID>
Store fd as an object, returning its verity digest.
If an object with the same digest already exists, this is a no-op and the existing digest is returned.
Sourcefn write_semaphore(&self) -> Arc<Semaphore> ⓘ
fn write_semaphore(&self) -> Arc<Semaphore> ⓘ
Return a semaphore that gates concurrent object writes.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".