1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
pub trait Decoder: Send + Sync {
    type Error;
    type Result: DecodingResult;
    fn decode(&self, error: &Self::Error) -> Self::Result;
    fn random_error(&self) -> Self::Error;
}

pub trait DecodingResult: Send + Sync {
    fn succeed(&self) -> bool;

    fn failed(&self) -> bool {
        !self.succeed()
    }
}

pub mod belief_propagation;
pub use belief_propagation::{BPDecoder, BPResult};

pub mod erasure;
pub use erasure::{ErasureDecoder, ErasureResult};