reed_solomon_simd::rate

Trait RateEncoder

Source
pub trait RateEncoder<E: Engine>
where Self: Sized,
{ type Rate: Rate<E>; // Required methods fn add_original_shard<T: AsRef<[u8]>>( &mut self, original_shard: T, ) -> Result<(), Error>; fn encode(&mut self) -> Result<EncoderResult<'_>, Error>; fn into_parts(self) -> (E, EncoderWork); fn new( original_count: usize, recovery_count: usize, shard_bytes: usize, engine: E, work: Option<EncoderWork>, ) -> 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 encoder using specific rate.

Required Associated Types§

Source

type Rate: Rate<E>

Rate of this encoder.

Required Methods§

Source

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

Source

fn encode(&mut self) -> Result<EncoderResult<'_>, Error>

Source

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

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

Source

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

Like ReedSolomonEncoder::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§