proxmox/proxmox-api-macro/tests/api2.rs
Wolfgang Bumiller d78659a2c0 api-macro: allow inferring some types automatically
non-optional boolean, string and integer types can be
inferred from the function

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-12-02 11:46:15 +01:00

20 lines
361 B
Rust

use proxmox_api_macro::api;
use failure::Error;
use serde_json::Value;
#[api(
input: {
properties: {
message: {
description: "The message to print",
}
}
}
)]
/// Print the given message.
pub fn hello(message: String) -> Result<(), Error> {
println!("Hello there. {}", message);
Ok(())
}