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§
Sourcefn encode(&self, data: Matrix2D) -> Result<Matrix2D>
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.
Sourcefn decode(&self, data: Matrix3D) -> Result<Matrix3D>
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.
Sourcefn max_chunks(&self) -> usize
fn max_chunks(&self) -> usize
Return the max. number of chunks each code supports in a 2D square.