fluvio_controlplane_metadata/smartmodule/
mod.rs1mod spec;
2mod status;
3mod package;
4mod params;
5mod spec_v1;
6
7pub use self::spec::*;
8pub use self::status::*;
9pub use self::package::*;
10
11#[cfg(feature = "k8")]
12mod k8;
13#[cfg(feature = "k8")]
14pub use k8::*;
15
16mod metadata {
17
18 use crate::core::{Spec, Status, Removable, Creatable};
19 use crate::extended::{SpecExt, ObjectType};
20
21 use super::*;
22
23 impl Spec for SmartModuleSpec {
24 const LABEL: &'static str = "SmartModule";
25 type IndexKey = String;
26 type Status = SmartModuleStatus;
27 type Owner = Self;
28 }
29
30 impl SpecExt for SmartModuleSpec {
31 const OBJECT_TYPE: ObjectType = ObjectType::SmartModule;
32 }
33
34 impl Removable for SmartModuleSpec {
35 type DeleteKey = String;
36 }
37
38 impl Creatable for SmartModuleSpec {}
39
40 impl Status for SmartModuleStatus {}
41
42 #[cfg(feature = "k8")]
43 mod extended {
44
45 use crate::store::k8::K8ExtendedSpec;
46 use crate::store::k8::K8ConvertError;
47 use crate::store::k8::K8MetaItem;
48 use crate::store::MetadataStoreObject;
49 use crate::k8_types::K8Obj;
50 use crate::store::k8::default_convert_from_k8;
51
52 use super::SmartModuleSpec;
53
54 impl K8ExtendedSpec for SmartModuleSpec {
55 type K8Spec = Self;
56
57 fn convert_from_k8(
58 k8_obj: K8Obj<Self::K8Spec>,
59 multi_namespace_context: bool,
60 ) -> Result<MetadataStoreObject<Self, K8MetaItem>, K8ConvertError<Self::K8Spec>>
61 {
62 default_convert_from_k8(k8_obj, multi_namespace_context)
63 }
64
65 fn convert_status_from_k8(status: Self::Status) -> Self::Status {
66 status
67 }
68
69 fn into_k8(self) -> Self::K8Spec {
70 self
71 }
72 }
73 }
74}