[−][src]Trait reed_solomon_erasure::ReconstructShard
Something which might hold a shard.
This trait is used in reconstruction, where some of the shards may be unknown.
Required methods
fn len(&self) -> Option<usize>
The size of the shard data; None
if empty.
fn get(&mut self) -> Option<&mut [F::Elem]>
Get a mutable reference to the shard data, returning None
if uninitialized.
fn get_or_initialize(
&mut self,
len: usize
) -> Result<&mut [F::Elem], Result<&mut [F::Elem], Error>>
&mut self,
len: usize
) -> Result<&mut [F::Elem], Result<&mut [F::Elem], Error>>
Get a mutable reference to the shard data, initializing it to the
given length if it was None
. Returns an error if initialization fails.
Implementations on Foreign Types
impl<F: Field, T: AsRef<[F::Elem]> + AsMut<[F::Elem]> + FromIterator<F::Elem>> ReconstructShard<F> for Option<T>
[src]
fn len(&self) -> Option<usize>
[src]
fn get(&mut self) -> Option<&mut [F::Elem]>
[src]
fn get_or_initialize(
&mut self,
len: usize
) -> Result<&mut [F::Elem], Result<&mut [F::Elem], Error>>
[src]
&mut self,
len: usize
) -> Result<&mut [F::Elem], Result<&mut [F::Elem], Error>>
impl<F: Field, T: AsRef<[F::Elem]> + AsMut<[F::Elem]>> ReconstructShard<F> for (T, bool)
[src]
fn len(&self) -> Option<usize>
[src]
fn get(&mut self) -> Option<&mut [F::Elem]>
[src]
fn get_or_initialize(
&mut self,
len: usize
) -> Result<&mut [F::Elem], Result<&mut [F::Elem], Error>>
[src]
&mut self,
len: usize
) -> Result<&mut [F::Elem], Result<&mut [F::Elem], Error>>