Function git_odb::pack::data::objects_to_entries_iter[][src]

pub fn objects_to_entries_iter<Locate, Iter, Oid, Cache>(
    db: Locate,
    make_cache: impl Fn() -> Cache + Send + Clone + Sync + 'static,
    objects: Iter,
    _progress: impl Progress,
    _: Options
) -> impl Iterator<Item = Result<Vec<Entry>, Error<Locate::Error>>> + Finalize<Reduce = IdentityWithResult<Vec<Entry>, Error<Locate::Error>>> where
    Locate: Find + Clone + Send + Sync + 'static,
    <Locate as Find>::Error: Send,
    Iter: Iterator<Item = Oid> + Send + 'static,
    Oid: AsRef<oid> + Send + 'static,
    Cache: DecodeEntry

Write all objects into out without attempting to apply any delta compression. This allows objects to be written rather immediately. Objects are held in memory and compressed using DEFLATE, with those in-flight chunks of compressed objects being sent to the current thread for writing. No buffering of these objects is performed, allowing for natural back-pressure in case of slow writers.

  • objects
    • the fully expanded list of objects, no expansion will be performed here.
  • progress
    • a way to obtain progress information
  • options
    • more configuration

Returns the checksum of the pack

Discussion

Advantages

  • Begins writing immediately and supports back-pressure.
  • Abstract over object databases and how input is provided.

Disadvantages

  • does not yet support thin packs as we don’t have a way to determine which objects are supposed to be thin.
  • currently there is no way to easily write the pack index, even though the state here is uniquely positioned to do so with minimal overhead (especially compared to gixp index-from-pack) Probably works now by chaining Iterators or keeping enough state to write a pack and then generate an index with recorded data.