Skip to main content

compress_write

Function compress_write 

Source
pub fn compress_write(filename: String, text: String) -> Result<()>
Expand description

Writes a PRTGN encoded file with lossless compression

    let filename = "test.prtgn".to_string();

    let text = "Hello world! This is some example text.".to_string();

    compress_write(filename, text).unwrap();
Examples found in repository?
examples/compressed_write.rs (line 8)
3fn main() {
4
5    let filename = "test.prtgn".to_string();
6    let text = "Hello world! This is some example text.".to_string();
7
8    compress_write(filename, text).unwrap();
9}
More examples
Hide additional examples
examples/compressed_read_write.rs (line 7)
3fn main() {
4    let filename = "test.prtgn".to_string();
5    let text = "Hello world! This is some example text.".to_string();
6
7    compress_write(filename, text).unwrap();
8
9    let filename = "test.prtgn".to_string();
10
11    let read_text = read(filename).unwrap().to_string();
12
13    println!("{}", read_text)
14}