[−][src]Function niffler::to_path
pub fn to_path<'a, P: AsRef<Path>>(
path: P,
format: Format,
level: Level
) -> Result<Box<dyn Write + 'a>, Error>
Create a file with specific compression format.
use niffler::{Error, compression}; let mut writer = niffler::to_path(file.path(), compression::Format::Gzip, compression::Level::Nine)?; writer.write_all(b"hello")?;