-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bb5eff
commit 1c3d3a9
Showing
22 changed files
with
238 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
/// Compression error | ||
#[derive(Debug)] | ||
pub struct CompressError(pub String); | ||
|
||
/// Decompression error | ||
#[derive(Debug)] | ||
pub struct DecompressError(pub String); | ||
|
||
/// Generic compression trait | ||
pub trait Compressor { | ||
/// Compresses a value | ||
/// | ||
/// # Errors | ||
/// | ||
/// Will return `Err` if an IO error occurs. | ||
fn compress(&self, bytes: &[u8]) -> Result<Vec<u8>, CompressError>; | ||
fn compress(&self, bytes: &[u8]) -> crate::Result<Vec<u8>>; | ||
|
||
/// Decompresses a value | ||
/// | ||
/// # Errors | ||
/// | ||
/// Will return `Err` if an IO error occurs. | ||
fn decompress(&self, bytes: &[u8]) -> Result<Vec<u8>, DecompressError>; | ||
fn decompress(&self, bytes: &[u8]) -> crate::Result<Vec<u8>>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.