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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! The sync module provides access to the
//! functions which allow for synchronising
//! back to labview.
//!
use c_void;
use PhantomData;
use crateResult;
use cratesync_api;
use crateMagicCookie;
type LVUserEventRef = MagicCookie;
/// Representation of a LabVIEW user event reference with type data.
///
/// Where the reference is passed into Rust you can use this typed form
/// to then allow proper type completions of the values.
///
/// From LabVIEW you can set the terminal to be `adapt to type` and `handles by value`
///
/// # Example
/// ```
/// # use labview_interop::sync::LVUserEvent;
/// # use labview_interop::types::LVStatusCode;
///#[no_mangle]
///pub extern "C" fn generate_event_3(lv_user_event: *mut LVUserEvent<i32>) -> LVStatusCode {
/// let event = unsafe { *lv_user_event };
/// let result = event.post(&mut 3);
/// match result {
/// Ok(_) => LVStatusCode::SUCCESS,
/// Err(err) => err.into(),
/// }
///}
/// ```
/// A LabVIEW occurence which can be used to provide synchronisation
/// between execution of Rust and LabVIEW code.
///
/// From LabVIEW you can set the terminal to be `adapt to type` and `handles by value`
///
/// # Example
/// ```
/// # use labview_interop::sync::Occurence;
/// # use labview_interop::types::LVStatusCode;
/// #[no_mangle]
///pub extern "C" fn generate_occurence(occurence: *mut Occurence) -> LVStatusCode {
/// let result = unsafe { (*occurence).set() };
/// match result {
/// Ok(_) => LVStatusCode::SUCCESS,
/// Err(err) => err.into(),
/// }
///}
/// ```
;