Skip to main content

encode_sector

Function encode_sector 

Source
pub fn encode_sector<RE>(
    downloaded_sector: DownloadedSector,
    encoding_options: EncodeSectorOptions<'_, RE>,
) -> Result<EncodedSector, PlottingError>
where RE: RecordsEncoder,
Expand description

Encode downloaded sector.

This function encodes downloaded sector records and returns sector encoding result that can be written using write_sector.

Returns an error if the records encoder returns a sector contents map with a wrong number of entries or bits, see RecordsEncoder.

Returns PlottingError::AbortEarly if abort_early is set once all the work is done, so the caller doesn’t need to check it again. It takes precedence over the map errors above, because the map may be incomplete when encoding stopped early.