Trait labrador_ldpc::encoder::EncodeInto [] [src]

pub trait EncodeInto {
    fn encode<'a>(code: &LDPCCode, codeword: &'a mut [Self]) -> &'a mut [u8]
    where
        Self: Sized
; fn copy_encode<'a>(
        code: &LDPCCode,
        data: &[u8],
        codeword: &'a mut [Self]
    ) -> &'a mut [u8]
    where
        Self: Sized
; fn bitlength() -> usize; }

Trait for the types of codeword we can encode into.

We implement this for u8 (the standard but slow option), and u32 and u64 which give speedups.

Required Methods

Given codeword which has the first k bits set to the data to transmit, sets the remaining n-k parity bits.

Returns a &mut [u8] view on codeword.

First copies data into the first k bits of codeword, then calls encode.

Returns the bit length for this type

Implementors