You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library provides Read and Write wrappers to handle (de)compression,
along with convenience functions to made common tasks easier.
For instance, stream::copy_encode and stream::copy_decode are easy-to-use
wrappers around std::io::copy. Check the stream example:
use std::io;// This function use the convenient `copy_encode` methodfncompress(level:i32){
zstd::stream::copy_encode(io::stdin(), io::stdout(), level).unwrap();}// This function does the same thing, directly using an `Encoder`:fncompress_manually(level:i32){letmut encoder = zstd::stream::Encoder::new(io::stdout(), level).unwrap();
io::copy(&mut io::stdin(),&mut encoder).unwrap();
encoder.finish().unwrap();}fndecompress(){
zstd::stream::copy_decode(io::stdin(), io::stdout()).unwrap();}
Asynchronous support
The async-compression crate
provides an async-ready integration of various compression algorithms,
including zstd-rs.
Compile it yourself
zstd is included as a submodule. To get everything during your clone, use: