pub trait ObjectSink {
// Required methods
fn put(&self, bytes: &[u8]) -> StoreResult<Hash>;
fn put_parts(&self, parts: &[&[u8]]) -> StoreResult<Hash>;
fn has(&self, h: &Hash) -> bool;
}Expand description
Write target shared by ObjectStore (per-object durability) and
WriteBatch (batched durability), so ingest code can be written
once against either sink.
Required Methods§
Sourcefn put(&self, bytes: &[u8]) -> StoreResult<Hash>
fn put(&self, bytes: &[u8]) -> StoreResult<Hash>
Store bytes as one object, returning its BLAKE3 hash.
Sourcefn put_parts(&self, parts: &[&[u8]]) -> StoreResult<Hash>
fn put_parts(&self, parts: &[&[u8]]) -> StoreResult<Hash>
Store the concatenation of parts as one object without the
caller having to materialise the concatenated buffer.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".