chiral_db_fp_kind/
openbabel.rs1#[derive(Clone, Debug)]
2pub enum Kind {
3 FP2 { nbits: u32 },
4 FP3 { nbits: u32 },
5 FP4 { nbits: u32 },
6 ECFP0 { nbits: u32 },
7 ECFP2 { nbits: u32 },
8 ECFP4 { nbits: u32 },
9 ECFP6 { nbits: u32 },
10 ECFP8 { nbits: u32 },
11 ECFP10 { nbits: u32 }
12}
13
14impl Kind {
15 pub fn as_str(&self) -> String {
16 let fp_name = match self {
17 Kind::FP2 { nbits: _ } => "FP2",
18 Kind::FP3 { nbits: _ } => "FP3",
19 Kind::FP4 { nbits: _ } => "FP4",
20 Kind::ECFP0 { nbits: _ } => "ECFP0",
21 Kind::ECFP2 { nbits: _ } => "ECFP2",
22 Kind::ECFP4 { nbits: _ } => "ECFP4",
23 Kind::ECFP6 { nbits: _ } => "ECFP6",
24 Kind::ECFP8 { nbits: _ } => "ECFP8",
25 Kind::ECFP10 { nbits: _ } => "ECFP10",
26 };
27 format!("{}", fp_name)
28 }
29
30 pub fn get_nbits(&self) -> &u32 {
31 match self {
32 Kind::FP2 { nbits } => nbits,
33 Kind::FP3 { nbits } => nbits,
34 Kind::FP4 { nbits } => nbits,
35 Kind::ECFP0 { nbits } => nbits,
36 Kind::ECFP2 { nbits } => nbits,
37 Kind::ECFP4 { nbits } => nbits,
38 Kind::ECFP6 { nbits } => nbits,
39 Kind::ECFP8 { nbits } => nbits,
40 Kind::ECFP10 { nbits } => nbits,
41 }
42 }
43}