Struct conserve::index::IndexBuilder
source · pub struct IndexBuilder { /* private fields */ }
Expand description
Accumulates ordered changes to the index and streams them out to index files.
Implementations§
source§impl IndexBuilder
impl IndexBuilder
Accumulate and write out index entries into files in an index directory.
sourcepub fn new(dir: &Path) -> IndexBuilder
pub fn new(dir: &Path) -> IndexBuilder
Make a new builder that will write files into the given directory.
sourcepub fn push(&mut self, entry: IndexEntry)
pub fn push(&mut self, entry: IndexEntry)
Append an entry to the index.
The new entry must sort after everything already written to the index.
pub fn maybe_flush(&mut self, report: &Report) -> Result<()>
sourcepub fn finish_hunk(&mut self, report: &Report) -> Result<()>
pub fn finish_hunk(&mut self, report: &Report) -> Result<()>
Finish this hunk of the index.
This writes all the currently queued entries into a new index file in the band directory, and then clears the index to start receiving entries for the next hunk.