pub trait SourceCoder {
// Required methods
fn try_compress(input: &[u8]) -> Result<Vec<u8>, ErrorsJSL>;
fn try_decompress(input: &[u8]) -> Result<Vec<u8>, ErrorsJSL>;
}Expand description
Common interface for byte-oriented source coders in this crate.
A source coder consumes raw bytes and either:
- produces a compressed byte stream with
try_compress, or - reconstructs the original bytes with
try_decompress
The methods are fallible so callers can handle malformed compressed data or
future codec-specific compression failures through the same Result type.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".