ark_api_ffi/entrypoints/
cmdlet.rs

1//! Cmdlet module entrypoints
2
3/// `ark_cmdlet_run` - Run cmdlet
4///
5/// The parameter is an argument string (UTF-8) that is stored in the Wasm module's memory.
6///
7/// # Returns
8///
9/// A return value of 0 means the cmdlet completed successful, non-zero means failure.
10/// On failure the function may return a UTF-8 string error message  with a the Ark return slice mechanism.
11///
12/// # Example
13///
14/// ```no_run
15/// #[no_mangle]
16/// fn ark_cmdlet_run(arg_str_ptr: *const u8, arg_str_size: u32) -> u32 {
17///     0
18/// }
19pub type CmdletRunFn = fn(arg_str_ptr: u32, arg_str_size: u32) -> u32;
20
21/// `ark_cmdlet_help` - Get help usage string from cmdlet
22///
23/// The function returns a UTF-8 string with the Ark return slice mechanism.
24///
25/// # Example
26///
27/// ```ignore
28/// #[no_mangle]
29/// fn ark_cmdlet_help() {
30/// }
31/// ```
32pub type CmdletHelpFn = fn();
33
34pub const CMDLET_RUN: &str = "ark_cmdlet_run";
35pub const CMDLET_HELP: &str = "ark_cmdlet_help";