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
mod client;
pub use fluvio_controlplane_metadata::smartmodule::*;
pub use client::*;

mod convert {

    use fluvio_controlplane_metadata::smartmodule::{SmartModuleWasmSummary, SmartModuleWasm};

    use crate::{AdminSpec, CreatableAdminSpec, DeletableAdminSpec};
    use super::SmartModuleSpec;

    impl AdminSpec for SmartModuleSpec {
        fn summary(self) -> Self {
            Self {
                meta: self.meta,
                summary: Some(SmartModuleWasmSummary {
                    wasm_length: self.wasm.payload.len() as u32,
                }),
                wasm: SmartModuleWasm::default(),
            }
        }
    }

    impl CreatableAdminSpec for SmartModuleSpec {}

    impl DeletableAdminSpec for SmartModuleSpec {
        type DeleteKey = String;
    }
}