picky_asn1/
lib.rs

1pub mod bit_string;
2pub mod date;
3pub mod restricted_string;
4pub mod tag;
5pub mod wrapper;
6
7use tag::Tag;
8
9pub trait Asn1Type {
10    const TAG: Tag;
11    const NAME: &'static str;
12}
13
14impl Asn1Type for () {
15    const TAG: Tag = Tag::NULL;
16    const NAME: &'static str = "()";
17}
18
19impl Asn1Type for String {
20    const TAG: Tag = Tag::UTF8_STRING;
21    const NAME: &'static str = "String";
22}
23
24impl Asn1Type for bool {
25    const TAG: Tag = Tag::BOOLEAN;
26    const NAME: &'static str = "bool";
27}
28
29impl Asn1Type for u8 {
30    const TAG: Tag = Tag::INTEGER;
31    const NAME: &'static str = "u8";
32}
33
34impl Asn1Type for u16 {
35    const TAG: Tag = Tag::INTEGER;
36    const NAME: &'static str = "u16";
37}
38
39impl Asn1Type for u32 {
40    const TAG: Tag = Tag::INTEGER;
41    const NAME: &'static str = "u32";
42}
43
44impl Asn1Type for u64 {
45    const TAG: Tag = Tag::INTEGER;
46    const NAME: &'static str = "u64";
47}
48
49impl Asn1Type for u128 {
50    const TAG: Tag = Tag::INTEGER;
51    const NAME: &'static str = "u128";
52}