pub trait BlobStore: Send + Sync {
// Required methods
fn put_bytes(&self, bytes: &[u8]) -> Result<ContentHash>;
fn get_bytes(&self, hash: &ContentHash) -> Result<Option<Vec<u8>>>;
fn contains(&self, hash: &ContentHash) -> Result<bool>;
}Expand description
Store of content-addressed blobs (the big table).
Required Methods§
Sourcefn put_bytes(&self, bytes: &[u8]) -> Result<ContentHash>
fn put_bytes(&self, bytes: &[u8]) -> Result<ContentHash>
Store bytes under their content hash. Idempotent: storing the same bytes twice is a no-op.
Sourcefn get_bytes(&self, hash: &ContentHash) -> Result<Option<Vec<u8>>>
fn get_bytes(&self, hash: &ContentHash) -> Result<Option<Vec<u8>>>
Read the blob at hash, None if absent (possibly evicted).
Sourcefn contains(&self, hash: &ContentHash) -> Result<bool>
fn contains(&self, hash: &ContentHash) -> Result<bool>
Whether a blob exists at hash, without reading it.