1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! # Async Load
//! This crate contains functionality to trigger GMS2 async events and pass data into them by using a `ds_map` structure inside a global `async_load` variable.
//!
//! # How To Use
//! In order to see how to use this library with your GMS2 extension, visit the [github repo](https://github.com/FssAy/async_load).
//!
//! # Example
//! Rust:
//! ```rust
//! #[no_mangle]
//! #[allow(non_snake_case, unused_variables)]
//! pub unsafe extern "C" fn MyFunction() -> GMLDouble {
//! use std::thread::*;
//! use std::time::Duration;
//!
//! // Spawn new thread.
//! spawn(|| {
//! // Wait for 1 second.
//! sleep(Duration::from_secs(1));
//!
//! // Create and dispatch the map.
//! let mut map = DSMap::new();
//! map.add_double("key1", 21.37);
//! map.add_string("key2", "Hello from Rust!");
//! map.dispatch(EventType::Social);
//! });
//!
//! GMLDouble::none()
//! }
//! ```
extern crate paste;
/// Export function that should be defined inside of GMS2 extension editor.
///
/// This function will be called automatically by the GMS2.
/// Do not call it manually.
///
/// Enable `extension` feature when building a "cdylib",
/// or leave it disabled if you want to define this function manually.
unsafe extern "C"