use serde::{Deserialize, Serialize};
use schemars::JsonSchema;
#[derive(Debug, Deserialize, JsonSchema)]
pub struct Input {
pub a: i64,
pub b: i64,
}
#[derive(Debug, Serialize, JsonSchema)]
pub struct Output {
pub sum: i64,
}
pub struct MathAdd;
impl MathAdd {
pub const MODULE_ID: &'static str = "math.add";
pub const DESCRIPTION: &'static str = "Add two integers and return their sum";
pub fn execute(input: Input) -> Output {
Output { sum: input.a + input.b }
}
}
fn main() {
let input = Input { a: 3, b: 4 };
let output = MathAdd::execute(input);
println!("{}", serde_json::to_string_pretty(&output).unwrap());
}