Trait chd::codecs::CodecImplementation
source · pub trait CodecImplementation {
// Required methods
fn new(hunk_size: u32) -> Result<Self>
where Self: Sized;
fn decompress(
&mut self,
input: &[u8],
output: &mut [u8],
) -> Result<DecompressResult>;
}
Available on
codec_api
only.Expand description
Trait for a CHD decompression codec implementation.
Required Methods§
sourcefn new(hunk_size: u32) -> Result<Self>where
Self: Sized,
fn new(hunk_size: u32) -> Result<Self>where
Self: Sized,
Creates a new instance of this codec for the provided hunk size.
sourcefn decompress(
&mut self,
input: &[u8],
output: &mut [u8],
) -> Result<DecompressResult>
fn decompress( &mut self, input: &[u8], output: &mut [u8], ) -> Result<DecompressResult>
Decompress compressed bytes from the input buffer into the output buffer.
Usually the output buffer must have the exact
length as hunk_size
, but this may be dependent on the codec
implementation.