1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
quick_error!{
    #[derive(Debug, PartialEq, Eq)]
    pub enum DecodeErr{
        NoEnoughDataErr{
            description("decoder: without enough data to read")
        }
        UnknownTarsTypeErr{
            description("decoder: unknown tars type")
        }
        TagNotFoundErr{
            description("decoder: Tag Not Found")
        }
        WrongSimpleListTarsTypeErr {
            description("decoder: wrong simple list type")
        }
    }
}

quick_error!{
    #[derive(Debug, PartialEq, Eq)]
    pub enum TarsTypeErr{
        DisMatchTarsTypeErr{
            description("tars_type: disMatch tars_type")
        }
    }
}

quick_error!{
    #[derive(Debug, PartialEq, Eq)]
    pub enum EncodeErr{
        TooBigTagErr{
            description("encoder: tag too big, max value is 255")
        }
        ConvertU8Err{
            description("encoder: cannot convert to u8")
        }
        BufferTooBigErr {
            description("encoder: BufferTooBigErr len bigger than 4294967295 bytes")
        }
    }
}