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§
Required Methods§
Sourcefn encode(&mut self) -> Result<EncoderResult<'_>, Error>
fn encode(&mut self) -> Result<EncoderResult<'_>, Error>
Sourcefn into_parts(self) -> (E, EncoderWork)
fn into_parts(self) -> (E, EncoderWork)
Consumes this encoder returning its Engine
and EncoderWork
so that they can be re-used by another encoder.
Provided Methods§
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.