Skip to main content

check_file

Function check_file 

Source
pub fn check_file(file: &Utf8Path) -> Result<Vec<u8>, AddError>
Expand description

Check file the way a fetch checks bytes off the wire, and return the bytes that passed – the only ones the store is given. Nothing past the magic number is interpreted (ADR-0003); the bytes are held, as a fetch holds a response body, never parsed.

§Errors

AddError::NotAFile, AddError::Symlink, AddError::TooLarge, AddError::NotAPdf or AddError::Io.