enc 0.19.0

This library aids in processing encoded data.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::Decoder;
use crate::test::data::util::test_coder;

/// Tests the `decoder`.
pub fn test_decoder<E, I, O>(decoder: &E, test_cases: &[(I, O)])
where
    E: Decoder,
    I: AsRef<[u8]>,
    O: AsRef<[u8]>,
{
    test_coder(
        test_cases,
        |input| decoder.decoded_len(input),
        |input, output| decoder.decode_to_slice(input, output),
        |input, output| decoder.append_to_vec(input, output),
        |input| decoder.decode_as_vec(input),
    )
}