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
fn encode<'a>(code: &LDPCCode, codeword: &'a mut [Self]) -> &'a mut [u8] where
Self: Sized,
Self: Sized,
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
.
fn copy_encode<'a>(
code: &LDPCCode,
data: &[u8],
codeword: &'a mut [Self]
) -> &'a mut [u8] where
Self: Sized,
code: &LDPCCode,
data: &[u8],
codeword: &'a mut [Self]
) -> &'a mut [u8] where
Self: Sized,
First copies data
into the first k bits of codeword
, then calls encode
.
fn bitlength() -> usize
Returns the bit length for this type
Implementors
impl EncodeInto for u8
impl EncodeInto for u32
impl EncodeInto for u64