reed_solomon_16::rate

Trait RateDecoder

Source
pub trait RateDecoder<E: Engine>
where Self: Sized,
{ type Rate: Rate<E>; // Required methods fn add_original_shard<T: AsRef<[u8]>>( &mut self, index: usize, original_shard: T, ) -> Result<(), Error>; fn add_recovery_shard<T: AsRef<[u8]>>( &mut self, index: usize, recovery_shard: T, ) -> Result<(), Error>; fn decode(&mut self) -> Result<DecoderResult<'_>, Error>; fn into_parts(self) -> (E, DecoderWork); fn new( original_count: usize, recovery_count: usize, shard_bytes: usize, engine: E, work: Option<DecoderWork>, ) -> Result<Self, Error>; fn reset( &mut self, original_count: usize, recovery_count: usize, shard_bytes: usize, ) -> Result<(), Error>; // Provided methods fn supports(original_count: usize, recovery_count: usize) -> bool { ... } fn validate( original_count: usize, recovery_count: usize, shard_bytes: usize, ) -> Result<(), Error> { ... } }
Expand description

Reed-Solomon decoder using specific rate.

Required Associated Types§

Source

type Rate: Rate<E>

Rate of this decoder.

Required Methods§

Source

fn add_original_shard<T: AsRef<[u8]>>( &mut self, index: usize, original_shard: T, ) -> Result<(), Error>

Source

fn add_recovery_shard<T: AsRef<[u8]>>( &mut self, index: usize, recovery_shard: T, ) -> Result<(), Error>

Source

fn decode(&mut self) -> Result<DecoderResult<'_>, Error>

Source

fn into_parts(self) -> (E, DecoderWork)

Consumes this decoder returning its Engine and DecoderWork so that they can be re-used by another decoder.

Source

fn new( original_count: usize, recovery_count: usize, shard_bytes: usize, engine: E, work: Option<DecoderWork>, ) -> Result<Self, Error>

Like ReedSolomonDecoder::new with Engine to use and optional working space to be re-used.

Source

fn reset( &mut self, original_count: usize, recovery_count: usize, shard_bytes: usize, ) -> Result<(), Error>

Provided Methods§

Source

fn supports(original_count: usize, recovery_count: usize) -> bool

Returns true if given original_count / recovery_count combination is supported.

This is same as Rate::supports.

Source

fn validate( original_count: usize, recovery_count: usize, shard_bytes: usize, ) -> Result<(), Error>

Returns Ok(()) if given original_count / recovery_count combination is supported and given shard_bytes is valid.

This is same as Rate::validate.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§