Skip to main content

Encode

Trait Encode 

Source
pub trait Encode {
    // Required methods
    fn rate(&self) -> f64;
    fn encode_into(&self, info: &Bits, out: &mut Bits) -> Result<()>;

    // Provided method
    fn encode(&self, info: &Bits) -> Result<Bits> { ... }
}
Expand description

Channel encoding of information bits into codewords.

Required Methods§

Source

fn rate(&self) -> f64

Code rate k/n.

Source

fn encode_into(&self, info: &Bits, out: &mut Bits) -> Result<()>

Encode info into out.

§Errors

When the length of info is not a multiple of the information length.

Provided Methods§

Source

fn encode(&self, info: &Bits) -> Result<Bits>

Encode info (allocates, calls Encode::encode_into).

§Errors

As Encode::encode_into.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§