scan_shard_classified_with_refusals

Function scan_shard_classified_with_refusals 

Source
pub fn scan_shard_classified_with_refusals(
    content: &[u8],
    range_start: usize,
    range_end: usize,
) -> (ShardRecords, Vec<u8>, Option<usize>, ShardRefusals)
Expand description

scan_shard_classified plus the byte offset of every record this shard refused because its instance name does not fit u32 (#3395).

The browser’s SAB-backed pre-scanned load hands the stitched shard columns straight to the parser worker, which cannot recover the refusals from the narrowed columns — the ids that were dropped are simply not there. So they have to ride along, and only a caller that asked for them pays for the extra binding. scan_shard_classified stays the 3-tuple it always was (an added return value would be a breaking change for a published crate) and delegates here, so there is one loop, not two.

Offsets rather than a count, for the reason spelled out on scan_shard_with_diagnostics: a shard that starts inside a quoted value refuses text the file never declared, so only the host’s stitch — which knows where this shard’s retained region begins — can tell a real refusal from an artefact of where the shard started. Handing back a count instead would let a clean file be reported as incomplete.