this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 56dd2efdc6a1f46df717bdfd0af3f3ed27874210 36 lines 999 B view raw
1use std::io::{Read, Write}; 2use std::path::Path; 3 4/// Trait for generic compression/extract over Read/Write objects 5pub trait CmprssRead { 6 fn compress<I: Read, O: Write>(&self, input: I, output: O); 7 fn extract<I: Read, O: Write>(&self, input: I, output: O); 8} 9 10/// Trait for compressing/extracting from a file. 11pub trait CmprssFile { 12 /// Compress an input file 13 fn compress_file<I: AsRef<Path>, O: Write>(&self, in_file: I, output: O); 14 15 /// Extract a file 16 fn extract_file<I: AsRef<Path>, O: Write>(&self, in_file: I, output: O); 17} 18 19pub struct CmprssCommonArgs { 20 pub compress: bool, 21 pub extract: bool, 22 pub input: String, 23 pub output: Option<String>, 24} 25 26/// Getter method for the common arguments 27pub trait CmprssArgTrait { 28 // TODO: There is probably a cleaner way to do this? 29 fn common_args(&self) -> &CmprssCommonArgs; 30} 31 32/// Generic info about the given compressor. 33pub trait CmprssInfo { 34 fn extension(&self) -> &str; 35 fn name(&self) -> &str; 36}