Skip to main content

ObjectSink

Trait ObjectSink 

Source
pub trait ObjectSink {
    // Required method
    fn write_object(&mut self, bytes: &[u8]) -> Result<Hash, BridgeError>;

    // Provided method
    fn kind_of(&self, _h: &Hash) -> Option<ObjectType> { ... }
}
Expand description

Where serialized mkit objects land. Implemented for mkit_core::ObjectStore (per-object fsync) and the CLI’s bulk writer; tests use an in-memory map.

Required Methods§

Source

fn write_object(&mut self, bytes: &[u8]) -> Result<Hash, BridgeError>

Provided Methods§

Source

fn kind_of(&self, _h: &Hash) -> Option<ObjectType>

The stored object’s type byte, when the sink can answer (used only to disambiguate blob vs chunked-manifest tag targets).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ObjectSink for ObjectStore

Source§

fn write_object(&mut self, bytes: &[u8]) -> Result<Hash, BridgeError>

Source§

fn kind_of(&self, h: &Hash) -> Option<ObjectType>

Implementors§