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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
//! The C ABI layer: the implementation behind `include/lmflow/flow.h`.
//!
//! Conventions:
//! * Every exported function is wrapped in `catch_unwind` — letting a Rust panic cross an FFI
//! boundary is undefined behaviour.
//! * On failure the thread-local `lmflow_last_error` is set, so the caller can obtain a readable
//! reason.
//! * Structs that cross the boundary are `#[repr(C)]`, with the layout pinned from both sides by
//! `tests/abi_layout.rs` and `cpp/abi_assert.cc`.
//! * Every exported function null-checks its pointers and returns an error code or a default
//! value rather than crashing.
//!
//! On `missing_safety_doc`: the functions here are consumed by **C callers**, whose safety
//! contract — pointer validity, ownership transfer, lifetimes — is authoritatively defined by the
//! comments in `include/lmflow/flow.h`, which is the documentation C and C++ users actually read.
//! Restating it here in Rust `# Safety` form would only create two descriptions that drift apart,
//! so the lint is waived for the whole module.
use ;
use ;
use Arc;
use crateContext;
use crateGraphInner;
use crateContract;
use crateKernelRunner;
use cratelast_error;
use crate;
pub const ABI_VERSION: u32 = 4;
pub const INVALID_ID: usize = usizeMAX;
pub const LMFLOW_POLLER_BLOCK: i32 = 0;
pub const LMFLOW_POLLER_DROP_OLDEST: i32 = 1;
pub const LMFLOW_POLLER_DROP_NEWEST: i32 = 2;
pub const LMFLOW_POLLER_LATEST: i32 = 3;
// ---------------------------------------------------------------- 工具
unsafe
unsafe
unsafe
unsafe
// ---------------------------------------------------------------- 不透明句柄
/// The object behind a graph input-port handle; its lifetime follows the graph.
// 按 API 域拆成子模块;`pub use` 把条目原样再导出,故 `lmflow::ffi::X` 路径不变。
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;