pub struct Hooks<'a> {
pub copied: &'a mut dyn FnMut(u8),
pub progress: &'a mut dyn FnMut(u64, u64),
pub needed: &'a mut dyn FnMut(u64, u64),
pub consumed: &'a mut dyn FnMut(u64, u64),
pub settle: &'a mut dyn FnMut(&mut dyn Write) -> Result<(), Error>,
}Expand description
What assemble_with reports while it writes.
Fields§
§copied: &'a mut dyn FnMut(u8)Called once each data section (a kind of DICT_DATA, INDEX_DATA,
QUAD_DATA, LABEL_DATA, TEXT_DATA or PYRAMID) is in the output:
the input bytes it came from are not read again.
progress: &'a mut dyn FnMut(u64, u64)(data bytes written so far, data bytes in all), after each write.
needed: &'a mut dyn FnMut(u64, u64)(input offset, length) of every payload range the copy will read,
announced once before the first byte is written.
consumed: &'a mut dyn FnMut(u64, u64)(input offset, length) of a payload range now in the output, whatever
order the ranges come in. Once every announced range of a spill file
has been consumed, nothing reads that file again.
settle: &'a mut dyn FnMut(&mut dyn Write) -> Result<(), Error>Called with the output after every copied run and every finished data
section, once consumed / copied may have made spill files ready to
go. The implementation flushes out, makes the bytes durable, and only
then deletes: a file must never be removed while its bytes are still in
a buffer or an unsynced page.