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 product: i64,
}
pub struct MathMultiply;
impl MathMultiply {
pub const MODULE_ID: &'static str = "math.multiply";
pub const DESCRIPTION: &'static str = "Multiply two integers and return their product";
pub fn execute(input: Input) -> Output {
Output { product: input.a * input.b }
}
}
fn main() {
let input = Input { a: 6, b: 7 };
let output = MathMultiply::execute(input);
println!("{}", serde_json::to_string_pretty(&output).unwrap());
}