DataSquare

Struct DataSquare 

Source
pub struct DataSquare {
    pub square_row: Matrix3D,
    pub square_col: Matrix3D,
    pub width: usize,
    pub original_width: usize,
    pub chunk_size: usize,
    pub row_roots: Matrix2D,
    pub col_roots: Matrix2D,
    pub codec: Box<dyn Codec>,
}
Expand description

Store all data for an original data square (ODS) or extended data square (EDS). Data is duplicated in both row-major and column-major order in order to be able to provide zero-allocation column slices.

Fields§

§square_row: Matrix3D§square_col: Matrix3D§width: usize§original_width: usize§chunk_size: usize§row_roots: Matrix2D§col_roots: Matrix2D§codec: Box<dyn Codec>

Implementations§

Source§

impl DataSquare

Source

pub fn new(original_data: Matrix2D) -> Result<Self>

Create a new data square. Data must be a square matrix. Data must not be empty.

§Arguments
  • original_data - Original data.
  • merkle_tree - MerkleTree.
§Returns
  • DataSquare - Data square.
  • Result - Error.
Source

pub fn erasure_extend_square(&mut self) -> Result<()>

Extend original square horizontally and vertically


| | | | O → | E | | ↓ | |


§| | | E | | |

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.