Struct reed_solomon_erasure::ReedSolomon
[−]
[src]
pub struct ReedSolomon { /* fields omitted */ }
Reed-Solomon erasure code encoder/decoder
Remarks
Notes about usage of offset
and byte_count
for all methods/functions below
offset
refers to start of the shard you want to as starting point for encoding/decoding.
offset
defaults to 0 if it is None
byte_count
refers to number of bytes, starting from offset
to use for encoding/decoding.
byte_count
defaults to length of shard if it is None
Methods
impl ReedSolomon
[src]
fn new(data_shards: usize, parity_shards: usize) -> ReedSolomon
[src]
Creates a new instance of Reed-Solomon erasure code encoder/decoder
fn data_shard_count(&self) -> usize
[src]
fn parity_shard_count(&self) -> usize
[src]
fn total_shard_count(&self) -> usize
[src]
fn encode_parity(
&self,
shards: &mut Vec<Shard>,
offset: Option<usize>,
byte_count: Option<usize>
)
[src]
&self,
shards: &mut Vec<Shard>,
offset: Option<usize>,
byte_count: Option<usize>
)
Constructs parity shards
Remarks
This overwrites data in the parity shard slots
Panics when the shards are of different sizes, number of shards does not match codec's configuration, or when the shards' length is shorter than required
fn is_parity_correct(
&self,
shards: &Vec<Shard>,
offset: Option<usize>,
byte_count: Option<usize>
) -> bool
[src]
&self,
shards: &Vec<Shard>,
offset: Option<usize>,
byte_count: Option<usize>
) -> bool
Verify correctness of parity shards
fn decode_missing(
&self,
shards: &mut Vec<Option<Shard>>,
offset: Option<usize>,
byte_count: Option<usize>
) -> Result<(), Error>
[src]
&self,
shards: &mut Vec<Option<Shard>>,
offset: Option<usize>,
byte_count: Option<usize>
) -> Result<(), Error>
Reconstruct missing shards
Remarks
Panics when the shards are of different sizes, number of shards does not match codec's configuration, or when the shards' length is shorter than required
Trait Implementations
impl PartialEq for ReedSolomon
[src]
fn eq(&self, __arg_0: &ReedSolomon) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ReedSolomon) -> bool
[src]
This method tests for !=
.
impl Debug for ReedSolomon
[src]
impl Clone for ReedSolomon
[src]
fn clone(&self) -> ReedSolomon
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more