reed_solomon_simd::rate

Trait Rate

Source
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§

Source

type RateEncoder: RateEncoder<E>

Encoder of this rate.

Source

type RateDecoder: RateDecoder<E>

Decoder of this rate.

Required Methods§

Source

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

Returns true if given original_count / recovery_count combination is supported.

Provided Methods§

Source

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.

Source

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.

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.

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§