read

Function read 

Source
pub fn read(path: impl AsRef<Path>) -> Result<Box<dyn Read>>
Expand description

Open a possibly compressed file for reading.

The file is specified by the given path. The file is decompressed by an external compression tool determined by the file extension:

  • .gz uses gzip
  • .bzip2 uses bzip2
  • .xz and .lzma uses xz
  • .zst uses zstd
  • everything else open the file directly without compression.