Struct reed_solomon_novelpoly::ReedSolomon
source · pub struct ReedSolomon { /* private fields */ }
Implementations§
source§impl ReedSolomon
impl ReedSolomon
pub fn encode<S: Shard>(&self, bytes: &[u8]) -> Result<Vec<S>>
sourcepub fn reconstruct<S: Shard>(
&self,
received_shards: Vec<Option<S>>
) -> Result<Vec<u8>>
pub fn reconstruct<S: Shard>( &self, received_shards: Vec<Option<S>> ) -> Result<Vec<u8>>
Reconstruct from chunks.
The result may be padded with zeros. Truncate the output to the expected byte length.
sourcepub fn reconstruct_from_systematic<S: Shard>(
&self,
chunks: Vec<S>
) -> Result<Vec<u8>>
pub fn reconstruct_from_systematic<S: Shard>( &self, chunks: Vec<S> ) -> Result<Vec<u8>>
Reconstruct from the set of systematic chunks.
Systematic chunks are the first k
chunks, which contain the initial data.
Provide a vector containing chunk data. If too few chunks are provided, recovery is not possible. The result may be padded with zeros. Truncate the output to the expected byte length.
Trait Implementations§
source§impl Clone for ReedSolomon
impl Clone for ReedSolomon
source§fn clone(&self) -> ReedSolomon
fn clone(&self) -> ReedSolomon
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ReedSolomon
impl Debug for ReedSolomon
source§impl PartialEq for ReedSolomon
impl PartialEq for ReedSolomon
source§fn eq(&self, other: &ReedSolomon) -> bool
fn eq(&self, other: &ReedSolomon) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ReedSolomon
impl StructuralEq for ReedSolomon
impl StructuralPartialEq for ReedSolomon
Auto Trait Implementations§
impl RefUnwindSafe for ReedSolomon
impl Send for ReedSolomon
impl Sync for ReedSolomon
impl Unpin for ReedSolomon
impl UnwindSafe for ReedSolomon
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more