ark-api-ffi 0.17.0-pre.15

Ark low-level Wasm FFI API
Documentation
define_api_id!(0xbb0f_0dfe_ff53_2a56, "applet-v1");

#[ark_api_macros::ark_bindgen(imports = "ark-applet-v1")]
mod applet {
    use crate::pod_helpers::Align16U128;
    type PlayerId = u64;

    extern "C" {
        /// A single 128-bit random value, unique to this run.
        ///
        /// Initialize your random number generators that need to be unpredictable from this.
        /// Not meant for cryptographic operations.
        #[deprecated_infallible]
        pub fn random_seed_value() -> Align16U128;

        /// Sets the system clipboard to a string.
        /// Later, this will require a special permission.
        #[deprecated_infallible]
        pub fn set_clipboard_string(string: &str);

        /// Sets the players clipboard to a string.
        ///
        /// This is done over network, so it is up to the client
        /// to refuse the request (with no feedback to the server).
        pub fn set_player_clipboard_string(player_id: PlayerId, string: &str);

        /// Gets the system clipboard, keeps it around and returns the length.
        ///
        /// note: This should really been called `clipboard_string` (without the `get_`) prefix, should fix for a future breaking version
        /// TODO: Replace this with one that actually just returns a `String`
        #[deprecated_infallible]
        pub fn get_clipboard_string() -> u32;

        /// Retrieves the actual string bytes, also clears the internal buffer.
        ///
        /// TODO: Replace this with one that actually just returns a `String`
        #[deprecated_infallible]
        pub fn retrieve_clipboard_string(string: &mut [u8]);
    }
}

pub use applet::*;