Trait BuildCoding

Source
pub trait BuildCoding<V> {
    type Coding: Coding<Value = V>;

    // Required methods
    fn name(&self) -> String;
    fn build_from_iter<Iter>(
        &self,
        iter: Iter,
        bits_per_fragment: u8,
    ) -> Self::Coding
       where Iter: IntoIterator,
             Iter::Item: Borrow<<Self::Coding as Coding>::Value>;
}
Expand description

Coding builder.

Required Associated Types§

Source

type Coding: Coding<Value = V>

Type of coding that self builds.

Required Methods§

Source

fn name(&self) -> String

Returns the name of self.

The name can be used by some cache systems to check if coding built by self is already in cache.

Source

fn build_from_iter<Iter>( &self, iter: Iter, bits_per_fragment: u8, ) -> Self::Coding
where Iter: IntoIterator, Iter::Item: Borrow<<Self::Coding as Coding>::Value>,

Build coding that uses given number of bits_per_fragment and is optimal for data provided by iter. If bits_per_fragment is 0, it is set automatically.

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§