Skip to main content

PayloadSink

Trait PayloadSink 

Source
pub trait PayloadSink {
    // Required method
    fn explode(
        &self,
        oid: &[u8],
        kind: GitObjectKind,
        payload: &[u8],
    ) -> Result<()>;
}
Expand description

Where every object the resolver produces is handed over.

A sink rather than a return value: crate::resolve::resolve_walked already drops a blob payload the moment nothing else in the pack deltas against it, and returning every payload instead would mean the whole pack inflated in RAM at once. Streaming it out keeps the resolver’s peak footprint exactly what it was before this table existed.

Required Methods§

Source

fn explode(&self, oid: &[u8], kind: GitObjectKind, payload: &[u8]) -> Result<()>

One resolved object: its oid, the type its chain resolves to, and the inflated payload. Called once per pack entry, never for a delta’s intermediate state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§