Skip to main content

ObjectSink

Trait ObjectSink 

Source
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§

Source

fn put(&self, bytes: &[u8]) -> StoreResult<Hash>

Store bytes as one object, returning its BLAKE3 hash.

Source

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.

Source

fn has(&self, h: &Hash) -> bool

True when the object is already present (or staged) in this sink.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§