pub struct ErasureEncoder { /* private fields */ }Expand description
Erasure encoder using Reed-Solomon
Implementations§
Source§impl ErasureEncoder
impl ErasureEncoder
Sourcepub fn new(data_shards: usize, parity_shards: usize) -> Result<Self>
pub fn new(data_shards: usize, parity_shards: usize) -> Result<Self>
Create new erasure encoder
Sourcepub fn decode(
&self,
shards: &[Option<Bytes>],
original_size: usize,
) -> Result<Bytes>
pub fn decode( &self, shards: &[Option<Bytes>], original_size: usize, ) -> Result<Bytes>
Decode data from shards (with possible losses)
Sourcepub fn min_shards(&self) -> usize
pub fn min_shards(&self) -> usize
Minimum shards needed for reconstruction
Sourcepub fn total_shards(&self) -> usize
pub fn total_shards(&self) -> usize
Total shards created
Sourcepub fn redundancy(&self) -> f64
pub fn redundancy(&self) -> f64
Redundancy factor
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErasureEncoder
impl RefUnwindSafe for ErasureEncoder
impl Send for ErasureEncoder
impl Sync for ErasureEncoder
impl Unpin for ErasureEncoder
impl UnsafeUnpin for ErasureEncoder
impl UnwindSafe for ErasureEncoder
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