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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#[derive(Default, Hash, Debug)]
pub struct TypeConfig {
pod_requests: Vec<String>,
allowlist: Vec<String>,
blocklist: Vec<String>,
}
impl TypeConfig {
pub fn new() -> Self {
Self::default()
}
pub(crate) fn note_pod_request(&mut self, tn: String) {
self.pod_requests.push(tn);
}
pub(crate) fn add_to_allowlist(&mut self, item: String) {
self.allowlist.push(item);
}
pub(crate) fn add_to_blocklist(&mut self, item: String) {
self.blocklist.push(item);
}
pub fn get_pod_requests(&self) -> &[String] {
&self.pod_requests
}
pub fn allowlist(&self) -> impl Iterator<Item = &String> {
self.allowlist.iter()
}
pub fn allowlist_is_empty(&self) -> bool {
self.allowlist.is_empty()
}
pub fn is_on_allowlist(&self, cpp_name: &str) -> bool {
self.allowlist.contains(&cpp_name.to_string())
}
pub fn is_on_blocklist(&self, cpp_name: &str) -> bool {
self.blocklist.contains(&cpp_name.to_string())
}
pub fn get_blocklist(&self) -> impl Iterator<Item = &String> {
self.blocklist.iter()
}
}