Skip to main content

interstice_abi/host_calls/
module.rs

1use crate::{NodeSelection, interstice_abi_macros::IntersticeType};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Serialize, Deserialize)]
5pub enum ModuleCall {
6    Publish {
7        node_selection: NodeSelection,
8        wasm_binary: Vec<u8>,
9    },
10    Remove {
11        node_selection: NodeSelection,
12        module_name: String,
13    },
14}
15
16#[derive(Debug, Serialize, Deserialize)]
17pub enum ModuleCallResponse {
18    Ok,
19    Err(String),
20}
21
22#[derive(Debug, Deserialize, Serialize, IntersticeType, Clone)]
23pub enum ModuleEvent {
24    PublishRequest {
25        node_id: String,
26        module_name: String,
27        wasm_binary: Vec<u8>,
28    },
29    RemoveRequest {
30        node_id: String,
31        module_name: String,
32    },
33}