ark-api-ffi 0.16.0

Ark low-level Wasm FFI API
Documentation
//! Cmdlet module entrypoints

/// `ark_cmdlet_run` - Run cmdlet
///
/// The parameter is an argument string (UTF-8) that is stored in the Wasm module's memory.
///
/// # Returns
///
/// A return value of 0 means the cmdlet completed successful, non-zero means failure.
/// On failure the function may return a UTF-8 string error message  with a the Ark return slice mechanism.
///
/// # Example
///
/// ```no_run
/// #[no_mangle]
/// fn ark_cmdlet_run(arg_str_ptr: *const u8, arg_str_size: u32) -> u32 {
///     0
/// }
pub type CmdletRunFn = fn(arg_str_ptr: u32, arg_str_size: u32) -> u32;

/// `ark_cmdlet_help` - Get help usage string from cmdlet
///
/// The function returns a UTF-8 string with the Ark return slice mechanism.
///
/// # Example
///
/// ```ignore
/// #[no_mangle]
/// fn ark_cmdlet_help() {
/// }
/// ```
pub type CmdletHelpFn = fn();

pub const CMDLET_RUN: &str = "ark_cmdlet_run";
pub const CMDLET_HELP: &str = "ark_cmdlet_help";