pub trait QualityCodec: Sized {
const TYPE_TAG: [u8; 16];
const LOSSY: bool;
const IS_IDENTITY: bool = false;
// Required methods
fn encode_into(
quality: &[u8],
output: &mut Vec<u8>,
) -> Result<(), DryIceError>;
fn decode_into(
encoded: &[u8],
original_len: usize,
output: &mut Vec<u8>,
) -> Result<(), DryIceError>;
// Provided methods
fn encode(quality: &[u8]) -> Result<Vec<u8>, DryIceError> { ... }
fn decode(
encoded: &[u8],
original_len: usize,
) -> Result<Vec<u8>, DryIceError> { ... }
}Expand description
A quality score encoding strategy for dryice blocks.
Implementors define how raw quality score bytes are encoded for
on-disk storage and decoded back. The crate provides
RawQualityCodec and BinnedQualityCodec as built-in
implementations, but users can implement this trait for custom
encodings.
Required Associated Constants§
Provided Associated Constants§
Sourceconst IS_IDENTITY: bool = false
const IS_IDENTITY: bool = false
Whether the encoded form is identical to the raw input bytes.
Required Methods§
Sourcefn encode_into(quality: &[u8], output: &mut Vec<u8>) -> Result<(), DryIceError>
fn encode_into(quality: &[u8], output: &mut Vec<u8>) -> Result<(), DryIceError>
Encode raw quality score bytes, appending the encoded bytes directly into the provided output buffer.
§Errors
Returns an error if the quality data is invalid for this encoding.
Sourcefn decode_into(
encoded: &[u8],
original_len: usize,
output: &mut Vec<u8>,
) -> Result<(), DryIceError>
fn decode_into( encoded: &[u8], original_len: usize, output: &mut Vec<u8>, ) -> Result<(), DryIceError>
Decode an encoded buffer, appending the decoded quality bytes directly into the provided output buffer.
original_len is the number of quality scores in the original
record, needed because some encodings may compress.
§Errors
Returns an error if the encoded data is corrupt or inconsistent.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.