k8s_openapi_ext/get/
secret.rs

1use super::*;
2
3pub trait SecretGetExt {
4    fn myself(&self) -> &corev1::Secret;
5
6    fn r#type(&self) -> Option<&str> {
7        self.myself().type_.as_deref()
8    }
9
10    fn data(&self) -> Option<&BTreeMap<String, ByteString>> {
11        self.myself().data.as_ref()
12    }
13
14    fn string_data(&self) -> Option<&BTreeMap<String, String>> {
15        self.myself().string_data.as_ref()
16    }
17
18    fn immutable(&self) -> Option<bool> {
19        self.myself().immutable
20    }
21
22    fn item(&self, key: &str) -> Option<&ByteString> {
23        self.data()?.get(key)
24    }
25}
26
27impl SecretGetExt for corev1::Secret {
28    #[inline(always)]
29    fn myself(&self) -> &corev1::Secret {
30        self
31    }
32}