Codec

Trait Codec 

Source
pub trait Codec {
    // Required methods
    fn encode(&self, data: Matrix2D) -> Result<Matrix2D>;
    fn decode(&self, data: Matrix3D) -> Result<Matrix3D>;
    fn max_chunks(&self) -> usize;
}
Expand description

Codec handle for encoding and decoding data

Required Methods§

Source

fn encode(&self, data: Matrix2D) -> Result<Matrix2D>

Encode encodes original data, automatically extracting share size. There must be no missing shares. Only returns parity shares.

Source

fn decode(&self, data: Matrix3D) -> Result<Matrix3D>

Decode sparse original + parity data, automatically extracting share size. Missing shares must be nil. Returns original shares only.

Source

fn max_chunks(&self) -> usize

Return the max. number of chunks each code supports in a 2D square.

Implementors§