Skip to main content

validate_shard_header

Function validate_shard_header 

Source
pub fn validate_shard_header(path: &Path) -> Result<(), ShardError>
Expand description

Validate that a shard file starts with the expected header line.

Reads only the first line and checks it matches [SHARD_HEADER]. Empty files or files starting with the correct header pass. Forwarding-pointer shards are silently accepted (legacy compat).

§Errors

Returns ShardError::CorruptedShard if the first line doesn’t match, or ShardError::Io if the file can’t be read.