is_text_file

Function is_text_file 

Source
pub fn is_text_file(path: &Path) -> Result<bool>
Expand description

Checks whether a file in path is a text file by loading the first 8000 bytes (or whole file) and checks if it contains 0 (NUL). The technique is used also by Git.