Commit 7059c8f
committed
Rework binding generation to reduce boilerplate
This is a pretty big (breaking!) change.
- Update OrbbecSDK submodule, vendor in crate
- Rework binding generation to change how properties work.
- Add macros for common patterns of calling orbbec sdk functions.
I've also collapsed the other PRs on this repo into this one, with
separate commits for each.
The first commit updates the OrbbecSDK submodule, and changes the build
process to vendor the contents of the OrbbecSDK folder into the crate.
Caveat: OrbbecSDK writes out a couple files to its source directory, so
we need to copy the whole source directory to OUT_DIR before building.
The next commit reworks the binding generation to use Rust-y enums
instead of raw integers. In many cases, we're now using the rust enums
directly in the public API. This isn't complete, since I would like to
rename struct members too (see rust-lang/rust-bindgen#3358).
The third commit adds macros for common patterns of calling the C SDK
functions, and rewrites all of the current calls to the C SDK to use
them.
I think my vision is to further reduce the sys/ layer so that src/ does
most of the work.
The rest of the commits are adding various features to the public API.
Topic: vendor-submodule1 parent d28b0aa commit 7059c8f
4 files changed
Lines changed: 95 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
16 | | - | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
1 | 6 | | |
2 | 7 | | |
3 | 8 | | |
4 | 9 | | |
5 | 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 | + | |
6 | 35 | | |
7 | | - | |
| 36 | + | |
8 | 37 | | |
9 | | - | |
10 | | - | |
| 38 | + | |
11 | 39 | | |
| 40 | + | |
| 41 | + | |
12 | 42 | | |
13 | 43 | | |
14 | 44 | | |
| |||
92 | 122 | | |
93 | 123 | | |
94 | 124 | | |
| 125 | + | |
| 126 | + | |
95 | 127 | | |
96 | 128 | | |
97 | 129 | | |
| |||
104 | 136 | | |
105 | 137 | | |
106 | 138 | | |
| 139 | + | |
| 140 | + | |
107 | 141 | | |
108 | 142 | | |
109 | 143 | | |
| |||
122 | 156 | | |
123 | 157 | | |
124 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
0 commit comments