pub trait Rate<E: Engine> {
type RateEncoder: RateEncoder<E>;
type RateDecoder: RateDecoder<E>;
// Required method
fn supports(original_count: usize, recovery_count: usize) -> bool;
// Provided methods
fn encoder(
original_count: usize,
recovery_count: usize,
shard_bytes: usize,
engine: E,
work: Option<EncoderWork>,
) -> Result<Self::RateEncoder, Error> { ... }
fn decoder(
original_count: usize,
recovery_count: usize,
shard_bytes: usize,
engine: E,
work: Option<DecoderWork>,
) -> Result<Self::RateDecoder, Error> { ... }
fn validate(
original_count: usize,
recovery_count: usize,
shard_bytes: usize,
) -> Result<(), Error> { ... }
}
Expand description
Reed-Solomon encoder/decoder generator using specific rate.
Required Associated Types§
Sourcetype RateEncoder: RateEncoder<E>
type RateEncoder: RateEncoder<E>
Encoder of this rate.
Sourcetype RateDecoder: RateDecoder<E>
type RateDecoder: RateDecoder<E>
Decoder of this rate.
Required Methods§
Provided Methods§
Sourcefn encoder(
original_count: usize,
recovery_count: usize,
shard_bytes: usize,
engine: E,
work: Option<EncoderWork>,
) -> Result<Self::RateEncoder, Error>
fn encoder( original_count: usize, recovery_count: usize, shard_bytes: usize, engine: E, work: Option<EncoderWork>, ) -> Result<Self::RateEncoder, Error>
Creates new encoder. This is same as RateEncoder::new
.
Sourcefn decoder(
original_count: usize,
recovery_count: usize,
shard_bytes: usize,
engine: E,
work: Option<DecoderWork>,
) -> Result<Self::RateDecoder, Error>
fn decoder( original_count: usize, recovery_count: usize, shard_bytes: usize, engine: E, work: Option<DecoderWork>, ) -> Result<Self::RateDecoder, Error>
Creates new decoder. This is same as RateDecoder::new
.
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.