lib-compression 0.1.0

Universal lossless compression via network-wide deduplication
Documentation
//! JIT assembler for shards

/// Assembles shards back into original data.
pub struct JitAssembler;

impl JitAssembler {
    pub fn new() -> Self {
        JitAssembler
    }

    /// Assemble shards into original data.
    pub fn assemble(&self, shards: &[Vec<u8>]) -> crate::Result<Vec<u8>> {
        // Stub: concatenate
        Ok(shards.iter().flatten().cloned().collect())
    }
}

impl Default for JitAssembler {
    fn default() -> Self {
        Self::new()
    }
}