@ohah/hwpjs 0.1.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/Hwpjs.podspec +27 -0
  2. package/LICENSE +21 -0
  3. package/README.md +87 -0
  4. package/android/CMakeLists.txt +50 -0
  5. package/android/build.gradle +110 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/src/main/AndroidManifest.xml +3 -0
  8. package/android/src/main/java/rs/craby/hwpjs/HwpjsPackage.kt +59 -0
  9. package/android/src/main/jni/OnLoad.cpp +22 -0
  10. package/android/src/main/jni/include/CrabySignals.h +53 -0
  11. package/android/src/main/jni/include/cxx.h +1150 -0
  12. package/android/src/main/jni/include/ffi.rs.h +1041 -0
  13. package/android/src/main/jni/libs/arm64-v8a/libhwpjs-prebuilt.a +0 -0
  14. package/android/src/main/jni/libs/arm64-v8a/libreactnative-prebuilt.a +0 -0
  15. package/android/src/main/jni/libs/armeabi-v7a/libhwpjs-prebuilt.a +0 -0
  16. package/android/src/main/jni/libs/armeabi-v7a/libreactnative-prebuilt.a +0 -0
  17. package/android/src/main/jni/libs/x86/libhwpjs-prebuilt.a +0 -0
  18. package/android/src/main/jni/libs/x86/libreactnative-prebuilt.a +0 -0
  19. package/android/src/main/jni/libs/x86_64/libhwpjs-prebuilt.a +0 -0
  20. package/android/src/main/jni/libs/x86_64/libreactnative-prebuilt.a +0 -0
  21. package/android/src/main/jni/src/ffi.rs.cc +1179 -0
  22. package/android/stubs/CMakeLists.txt +31 -0
  23. package/android/stubs/Hwpjs_stub.cpp +9 -0
  24. package/android/stubs/Hwpjs_stub.h +12 -0
  25. package/cpp/CrabyUtils.hpp +91 -0
  26. package/cpp/CxxHwpjsModule.cpp +125 -0
  27. package/cpp/CxxHwpjsModule.hpp +53 -0
  28. package/cpp/bridging-generated.hpp +158 -0
  29. package/dist/browser.js +1 -0
  30. package/dist/hwpjs-napi.wasi-browser.js +61 -0
  31. package/dist/hwpjs-napi.wasi.cjs +113 -0
  32. package/dist/hwpjs.wasi-browser.js +61 -0
  33. package/dist/hwpjs.wasi.cjs +113 -0
  34. package/dist/index.d.ts +97 -0
  35. package/dist/index.js +577 -0
  36. package/dist/react-native/index.cjs +40 -0
  37. package/dist/react-native/index.cjs.map +1 -0
  38. package/dist/react-native/index.d.cts +22 -0
  39. package/dist/react-native/index.d.mts +22 -0
  40. package/dist/react-native/index.mjs +40 -0
  41. package/dist/react-native/index.mjs.map +1 -0
  42. package/dist/wasi-worker-browser.mjs +32 -0
  43. package/dist/wasi-worker.mjs +63 -0
  44. package/ios/HwpjsModuleProvider.mm +47 -0
  45. package/ios/framework/libhwpjs.xcframework/Info.plist +44 -0
  46. package/ios/framework/libhwpjs.xcframework/ios-arm64/libhwpjs-prebuilt.a +0 -0
  47. package/ios/framework/libhwpjs.xcframework/ios-arm64_x86_64-simulator/libhwpjs-prebuilt.a +0 -0
  48. package/ios/framework/libreactnative.xcframework/Info.plist +44 -0
  49. package/ios/framework/libreactnative.xcframework/ios-arm64/libreactnative-prebuilt.a +0 -0
  50. package/ios/framework/libreactnative.xcframework/ios-arm64_x86_64-simulator/libreactnative-prebuilt.a +0 -0
  51. package/ios/include/CrabySignals.h +53 -0
  52. package/ios/include/cxx.h +1150 -0
  53. package/ios/include/ffi.rs.h +1041 -0
  54. package/ios/src/ffi.rs.cc +1179 -0
  55. package/package.json +147 -0
  56. package/react-native.config.js +24 -0
@@ -0,0 +1,1179 @@
1
+ #include <algorithm>
2
+ #include <array>
3
+ #include <cassert>
4
+ #include <cstddef>
5
+ #include <cstdint>
6
+ #include <exception>
7
+ #include <initializer_list>
8
+ #include <iterator>
9
+ #include <new>
10
+ #include <stdexcept>
11
+ #include <string>
12
+ #include <type_traits>
13
+ #include <utility>
14
+ #if __cplusplus >= 201703L
15
+ #include <string_view>
16
+ #endif
17
+ #if __cplusplus >= 202002L
18
+ #include <ranges>
19
+ #endif
20
+
21
+ #ifdef __GNUC__
22
+ #pragma GCC diagnostic ignored "-Wmissing-declarations"
23
+ #pragma GCC diagnostic ignored "-Wshadow"
24
+ #ifdef __clang__
25
+ #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
26
+ #endif // __clang__
27
+ #endif // __GNUC__
28
+
29
+ namespace rust {
30
+ inline namespace cxxbridge1 {
31
+ // #include "rust/cxx.h"
32
+
33
+ #ifndef CXXBRIDGE1_PANIC
34
+ #define CXXBRIDGE1_PANIC
35
+ template <typename Exception>
36
+ void panic [[noreturn]] (const char *msg);
37
+ #endif // CXXBRIDGE1_PANIC
38
+
39
+ struct unsafe_bitcopy_t;
40
+
41
+ namespace {
42
+ template <typename T>
43
+ class impl;
44
+ } // namespace
45
+
46
+ template <typename T>
47
+ ::std::size_t size_of();
48
+ template <typename T>
49
+ ::std::size_t align_of();
50
+
51
+ #ifndef CXXBRIDGE1_RUST_STRING
52
+ #define CXXBRIDGE1_RUST_STRING
53
+ class String final {
54
+ public:
55
+ String() noexcept;
56
+ String(const String &) noexcept;
57
+ String(String &&) noexcept;
58
+ ~String() noexcept;
59
+
60
+ String(const std::string &);
61
+ String(const char *);
62
+ String(const char *, std::size_t);
63
+ String(const char16_t *);
64
+ String(const char16_t *, std::size_t);
65
+ #ifdef __cpp_char8_t
66
+ String(const char8_t *s);
67
+ String(const char8_t *s, std::size_t len);
68
+ #endif
69
+
70
+ static String lossy(const std::string &) noexcept;
71
+ static String lossy(const char *) noexcept;
72
+ static String lossy(const char *, std::size_t) noexcept;
73
+ static String lossy(const char16_t *) noexcept;
74
+ static String lossy(const char16_t *, std::size_t) noexcept;
75
+
76
+ String &operator=(const String &) & noexcept;
77
+ String &operator=(String &&) & noexcept;
78
+
79
+ explicit operator std::string() const;
80
+
81
+ const char *data() const noexcept;
82
+ std::size_t size() const noexcept;
83
+ std::size_t length() const noexcept;
84
+ bool empty() const noexcept;
85
+
86
+ const char *c_str() noexcept;
87
+
88
+ std::size_t capacity() const noexcept;
89
+ void reserve(size_t new_cap) noexcept;
90
+
91
+ using iterator = char *;
92
+ iterator begin() noexcept;
93
+ iterator end() noexcept;
94
+
95
+ using const_iterator = const char *;
96
+ const_iterator begin() const noexcept;
97
+ const_iterator end() const noexcept;
98
+ const_iterator cbegin() const noexcept;
99
+ const_iterator cend() const noexcept;
100
+
101
+ bool operator==(const String &) const noexcept;
102
+ bool operator!=(const String &) const noexcept;
103
+ bool operator<(const String &) const noexcept;
104
+ bool operator<=(const String &) const noexcept;
105
+ bool operator>(const String &) const noexcept;
106
+ bool operator>=(const String &) const noexcept;
107
+
108
+ void swap(String &) noexcept;
109
+
110
+ String(unsafe_bitcopy_t, const String &) noexcept;
111
+
112
+ private:
113
+ struct lossy_t;
114
+ String(lossy_t, const char *, std::size_t) noexcept;
115
+ String(lossy_t, const char16_t *, std::size_t) noexcept;
116
+ friend void swap(String &lhs, String &rhs) noexcept { lhs.swap(rhs); }
117
+
118
+ std::array<std::uintptr_t, 3> repr;
119
+ };
120
+ #endif // CXXBRIDGE1_RUST_STRING
121
+
122
+ #ifndef CXXBRIDGE1_RUST_STR
123
+ #define CXXBRIDGE1_RUST_STR
124
+ class Str final {
125
+ public:
126
+ Str() noexcept;
127
+ Str(const String &) noexcept;
128
+ Str(const std::string &);
129
+ Str(const char *);
130
+ Str(const char *, std::size_t);
131
+
132
+ Str &operator=(const Str &) & noexcept = default;
133
+
134
+ explicit operator std::string() const;
135
+ #if __cplusplus >= 201703L
136
+ explicit operator std::string_view() const;
137
+ #endif
138
+
139
+ const char *data() const noexcept;
140
+ std::size_t size() const noexcept;
141
+ std::size_t length() const noexcept;
142
+ bool empty() const noexcept;
143
+
144
+ Str(const Str &) noexcept = default;
145
+ ~Str() noexcept = default;
146
+
147
+ using iterator = const char *;
148
+ using const_iterator = const char *;
149
+ const_iterator begin() const noexcept;
150
+ const_iterator end() const noexcept;
151
+ const_iterator cbegin() const noexcept;
152
+ const_iterator cend() const noexcept;
153
+
154
+ bool operator==(const Str &) const noexcept;
155
+ bool operator!=(const Str &) const noexcept;
156
+ bool operator<(const Str &) const noexcept;
157
+ bool operator<=(const Str &) const noexcept;
158
+ bool operator>(const Str &) const noexcept;
159
+ bool operator>=(const Str &) const noexcept;
160
+
161
+ void swap(Str &) noexcept;
162
+
163
+ private:
164
+ class uninit;
165
+ Str(uninit) noexcept;
166
+ friend impl<Str>;
167
+
168
+ std::array<std::uintptr_t, 2> repr;
169
+ };
170
+ #endif // CXXBRIDGE1_RUST_STR
171
+
172
+ #ifndef CXXBRIDGE1_RUST_SLICE
173
+ #define CXXBRIDGE1_RUST_SLICE
174
+ namespace detail {
175
+ template <bool>
176
+ struct copy_assignable_if {};
177
+
178
+ template <>
179
+ struct copy_assignable_if<false> {
180
+ copy_assignable_if() noexcept = default;
181
+ copy_assignable_if(const copy_assignable_if &) noexcept = default;
182
+ copy_assignable_if &operator=(const copy_assignable_if &) & noexcept = delete;
183
+ copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default;
184
+ };
185
+ } // namespace detail
186
+
187
+ template <typename T>
188
+ class Slice final
189
+ : private detail::copy_assignable_if<std::is_const<T>::value> {
190
+ public:
191
+ using value_type = T;
192
+
193
+ Slice() noexcept;
194
+ Slice(T *, std::size_t count) noexcept;
195
+
196
+ template <typename C>
197
+ explicit Slice(C &c) : Slice(c.data(), c.size()) {}
198
+
199
+ Slice &operator=(const Slice<T> &) & noexcept = default;
200
+ Slice &operator=(Slice<T> &&) & noexcept = default;
201
+
202
+ T *data() const noexcept;
203
+ std::size_t size() const noexcept;
204
+ std::size_t length() const noexcept;
205
+ bool empty() const noexcept;
206
+
207
+ T &operator[](std::size_t n) const noexcept;
208
+ T &at(std::size_t n) const;
209
+ T &front() const noexcept;
210
+ T &back() const noexcept;
211
+
212
+ Slice(const Slice<T> &) noexcept = default;
213
+ ~Slice() noexcept = default;
214
+
215
+ class iterator;
216
+ iterator begin() const noexcept;
217
+ iterator end() const noexcept;
218
+
219
+ void swap(Slice &) noexcept;
220
+
221
+ private:
222
+ class uninit;
223
+ Slice(uninit) noexcept;
224
+ friend impl<Slice>;
225
+ friend void sliceInit(void *, const void *, std::size_t) noexcept;
226
+ friend void *slicePtr(const void *) noexcept;
227
+ friend std::size_t sliceLen(const void *) noexcept;
228
+
229
+ std::array<std::uintptr_t, 2> repr;
230
+ };
231
+
232
+ #ifdef __cpp_deduction_guides
233
+ template <typename C>
234
+ explicit Slice(C &c)
235
+ -> Slice<std::remove_reference_t<decltype(*std::declval<C>().data())>>;
236
+ #endif // __cpp_deduction_guides
237
+
238
+ template <typename T>
239
+ class Slice<T>::iterator final {
240
+ public:
241
+ #if __cplusplus >= 202002L
242
+ using iterator_category = std::contiguous_iterator_tag;
243
+ #else
244
+ using iterator_category = std::random_access_iterator_tag;
245
+ #endif
246
+ using value_type = T;
247
+ using difference_type = std::ptrdiff_t;
248
+ using pointer = typename std::add_pointer<T>::type;
249
+ using reference = typename std::add_lvalue_reference<T>::type;
250
+
251
+ reference operator*() const noexcept;
252
+ pointer operator->() const noexcept;
253
+ reference operator[](difference_type) const noexcept;
254
+
255
+ iterator &operator++() noexcept;
256
+ iterator operator++(int) noexcept;
257
+ iterator &operator--() noexcept;
258
+ iterator operator--(int) noexcept;
259
+
260
+ iterator &operator+=(difference_type) noexcept;
261
+ iterator &operator-=(difference_type) noexcept;
262
+ iterator operator+(difference_type) const noexcept;
263
+ friend inline iterator operator+(difference_type lhs, iterator rhs) noexcept {
264
+ return rhs + lhs;
265
+ }
266
+ iterator operator-(difference_type) const noexcept;
267
+ difference_type operator-(const iterator &) const noexcept;
268
+
269
+ bool operator==(const iterator &) const noexcept;
270
+ bool operator!=(const iterator &) const noexcept;
271
+ bool operator<(const iterator &) const noexcept;
272
+ bool operator<=(const iterator &) const noexcept;
273
+ bool operator>(const iterator &) const noexcept;
274
+ bool operator>=(const iterator &) const noexcept;
275
+
276
+ private:
277
+ friend class Slice;
278
+ void *pos;
279
+ std::size_t stride;
280
+ };
281
+
282
+ #if __cplusplus >= 202002L
283
+ static_assert(std::ranges::contiguous_range<rust::Slice<const uint8_t>>);
284
+ static_assert(std::contiguous_iterator<rust::Slice<const uint8_t>::iterator>);
285
+ #endif
286
+
287
+ template <typename T>
288
+ Slice<T>::Slice() noexcept {
289
+ sliceInit(this, reinterpret_cast<void *>(align_of<T>()), 0);
290
+ }
291
+
292
+ template <typename T>
293
+ Slice<T>::Slice(T *s, std::size_t count) noexcept {
294
+ assert(s != nullptr || count == 0);
295
+ sliceInit(this,
296
+ s == nullptr && count == 0
297
+ ? reinterpret_cast<void *>(align_of<T>())
298
+ : const_cast<typename std::remove_const<T>::type *>(s),
299
+ count);
300
+ }
301
+
302
+ template <typename T>
303
+ T *Slice<T>::data() const noexcept {
304
+ return reinterpret_cast<T *>(slicePtr(this));
305
+ }
306
+
307
+ template <typename T>
308
+ std::size_t Slice<T>::size() const noexcept {
309
+ return sliceLen(this);
310
+ }
311
+
312
+ template <typename T>
313
+ std::size_t Slice<T>::length() const noexcept {
314
+ return this->size();
315
+ }
316
+
317
+ template <typename T>
318
+ bool Slice<T>::empty() const noexcept {
319
+ return this->size() == 0;
320
+ }
321
+
322
+ template <typename T>
323
+ T &Slice<T>::operator[](std::size_t n) const noexcept {
324
+ assert(n < this->size());
325
+ auto ptr = static_cast<char *>(slicePtr(this)) + size_of<T>() * n;
326
+ return *reinterpret_cast<T *>(ptr);
327
+ }
328
+
329
+ template <typename T>
330
+ T &Slice<T>::at(std::size_t n) const {
331
+ if (n >= this->size()) {
332
+ panic<std::out_of_range>("rust::Slice index out of range");
333
+ }
334
+ return (*this)[n];
335
+ }
336
+
337
+ template <typename T>
338
+ T &Slice<T>::front() const noexcept {
339
+ assert(!this->empty());
340
+ return (*this)[0];
341
+ }
342
+
343
+ template <typename T>
344
+ T &Slice<T>::back() const noexcept {
345
+ assert(!this->empty());
346
+ return (*this)[this->size() - 1];
347
+ }
348
+
349
+ template <typename T>
350
+ typename Slice<T>::iterator::reference
351
+ Slice<T>::iterator::operator*() const noexcept {
352
+ return *static_cast<T *>(this->pos);
353
+ }
354
+
355
+ template <typename T>
356
+ typename Slice<T>::iterator::pointer
357
+ Slice<T>::iterator::operator->() const noexcept {
358
+ return static_cast<T *>(this->pos);
359
+ }
360
+
361
+ template <typename T>
362
+ typename Slice<T>::iterator::reference Slice<T>::iterator::operator[](
363
+ typename Slice<T>::iterator::difference_type n) const noexcept {
364
+ auto ptr = static_cast<char *>(this->pos) + this->stride * n;
365
+ return *reinterpret_cast<T *>(ptr);
366
+ }
367
+
368
+ template <typename T>
369
+ typename Slice<T>::iterator &Slice<T>::iterator::operator++() noexcept {
370
+ this->pos = static_cast<char *>(this->pos) + this->stride;
371
+ return *this;
372
+ }
373
+
374
+ template <typename T>
375
+ typename Slice<T>::iterator Slice<T>::iterator::operator++(int) noexcept {
376
+ auto ret = iterator(*this);
377
+ this->pos = static_cast<char *>(this->pos) + this->stride;
378
+ return ret;
379
+ }
380
+
381
+ template <typename T>
382
+ typename Slice<T>::iterator &Slice<T>::iterator::operator--() noexcept {
383
+ this->pos = static_cast<char *>(this->pos) - this->stride;
384
+ return *this;
385
+ }
386
+
387
+ template <typename T>
388
+ typename Slice<T>::iterator Slice<T>::iterator::operator--(int) noexcept {
389
+ auto ret = iterator(*this);
390
+ this->pos = static_cast<char *>(this->pos) - this->stride;
391
+ return ret;
392
+ }
393
+
394
+ template <typename T>
395
+ typename Slice<T>::iterator &Slice<T>::iterator::operator+=(
396
+ typename Slice<T>::iterator::difference_type n) noexcept {
397
+ this->pos = static_cast<char *>(this->pos) + this->stride * n;
398
+ return *this;
399
+ }
400
+
401
+ template <typename T>
402
+ typename Slice<T>::iterator &Slice<T>::iterator::operator-=(
403
+ typename Slice<T>::iterator::difference_type n) noexcept {
404
+ this->pos = static_cast<char *>(this->pos) - this->stride * n;
405
+ return *this;
406
+ }
407
+
408
+ template <typename T>
409
+ typename Slice<T>::iterator Slice<T>::iterator::operator+(
410
+ typename Slice<T>::iterator::difference_type n) const noexcept {
411
+ auto ret = iterator(*this);
412
+ ret.pos = static_cast<char *>(this->pos) + this->stride * n;
413
+ return ret;
414
+ }
415
+
416
+ template <typename T>
417
+ typename Slice<T>::iterator Slice<T>::iterator::operator-(
418
+ typename Slice<T>::iterator::difference_type n) const noexcept {
419
+ auto ret = iterator(*this);
420
+ ret.pos = static_cast<char *>(this->pos) - this->stride * n;
421
+ return ret;
422
+ }
423
+
424
+ template <typename T>
425
+ typename Slice<T>::iterator::difference_type
426
+ Slice<T>::iterator::operator-(const iterator &other) const noexcept {
427
+ auto diff = std::distance(static_cast<char *>(other.pos),
428
+ static_cast<char *>(this->pos));
429
+ return diff / static_cast<typename Slice<T>::iterator::difference_type>(
430
+ this->stride);
431
+ }
432
+
433
+ template <typename T>
434
+ bool Slice<T>::iterator::operator==(const iterator &other) const noexcept {
435
+ return this->pos == other.pos;
436
+ }
437
+
438
+ template <typename T>
439
+ bool Slice<T>::iterator::operator!=(const iterator &other) const noexcept {
440
+ return this->pos != other.pos;
441
+ }
442
+
443
+ template <typename T>
444
+ bool Slice<T>::iterator::operator<(const iterator &other) const noexcept {
445
+ return this->pos < other.pos;
446
+ }
447
+
448
+ template <typename T>
449
+ bool Slice<T>::iterator::operator<=(const iterator &other) const noexcept {
450
+ return this->pos <= other.pos;
451
+ }
452
+
453
+ template <typename T>
454
+ bool Slice<T>::iterator::operator>(const iterator &other) const noexcept {
455
+ return this->pos > other.pos;
456
+ }
457
+
458
+ template <typename T>
459
+ bool Slice<T>::iterator::operator>=(const iterator &other) const noexcept {
460
+ return this->pos >= other.pos;
461
+ }
462
+
463
+ template <typename T>
464
+ typename Slice<T>::iterator Slice<T>::begin() const noexcept {
465
+ iterator it;
466
+ it.pos = slicePtr(this);
467
+ it.stride = size_of<T>();
468
+ return it;
469
+ }
470
+
471
+ template <typename T>
472
+ typename Slice<T>::iterator Slice<T>::end() const noexcept {
473
+ iterator it = this->begin();
474
+ it.pos = static_cast<char *>(it.pos) + it.stride * this->size();
475
+ return it;
476
+ }
477
+
478
+ template <typename T>
479
+ void Slice<T>::swap(Slice &rhs) noexcept {
480
+ std::swap(*this, rhs);
481
+ }
482
+ #endif // CXXBRIDGE1_RUST_SLICE
483
+
484
+ #ifndef CXXBRIDGE1_RUST_BOX
485
+ #define CXXBRIDGE1_RUST_BOX
486
+ template <typename T>
487
+ class Box final {
488
+ public:
489
+ using element_type = T;
490
+ using const_pointer =
491
+ typename std::add_pointer<typename std::add_const<T>::type>::type;
492
+ using pointer = typename std::add_pointer<T>::type;
493
+
494
+ Box() = delete;
495
+ Box(Box &&) noexcept;
496
+ ~Box() noexcept;
497
+
498
+ explicit Box(const T &);
499
+ explicit Box(T &&);
500
+
501
+ Box &operator=(Box &&) & noexcept;
502
+
503
+ const T *operator->() const noexcept;
504
+ const T &operator*() const noexcept;
505
+ T *operator->() noexcept;
506
+ T &operator*() noexcept;
507
+
508
+ template <typename... Fields>
509
+ static Box in_place(Fields &&...);
510
+
511
+ void swap(Box &) noexcept;
512
+
513
+ static Box from_raw(T *) noexcept;
514
+
515
+ T *into_raw() noexcept;
516
+
517
+ /* Deprecated */ using value_type = element_type;
518
+
519
+ private:
520
+ class uninit;
521
+ class allocation;
522
+ Box(uninit) noexcept;
523
+ void drop() noexcept;
524
+
525
+ friend void swap(Box &lhs, Box &rhs) noexcept { lhs.swap(rhs); }
526
+
527
+ T *ptr;
528
+ };
529
+
530
+ template <typename T>
531
+ class Box<T>::uninit {};
532
+
533
+ template <typename T>
534
+ class Box<T>::allocation {
535
+ static T *alloc() noexcept;
536
+ static void dealloc(T *) noexcept;
537
+
538
+ public:
539
+ allocation() noexcept : ptr(alloc()) {}
540
+ ~allocation() noexcept {
541
+ if (this->ptr) {
542
+ dealloc(this->ptr);
543
+ }
544
+ }
545
+ T *ptr;
546
+ };
547
+
548
+ template <typename T>
549
+ Box<T>::Box(Box &&other) noexcept : ptr(other.ptr) {
550
+ other.ptr = nullptr;
551
+ }
552
+
553
+ template <typename T>
554
+ Box<T>::Box(const T &val) {
555
+ allocation alloc;
556
+ ::new (alloc.ptr) T(val);
557
+ this->ptr = alloc.ptr;
558
+ alloc.ptr = nullptr;
559
+ }
560
+
561
+ template <typename T>
562
+ Box<T>::Box(T &&val) {
563
+ allocation alloc;
564
+ ::new (alloc.ptr) T(std::move(val));
565
+ this->ptr = alloc.ptr;
566
+ alloc.ptr = nullptr;
567
+ }
568
+
569
+ template <typename T>
570
+ Box<T>::~Box() noexcept {
571
+ if (this->ptr) {
572
+ this->drop();
573
+ }
574
+ }
575
+
576
+ template <typename T>
577
+ Box<T> &Box<T>::operator=(Box &&other) & noexcept {
578
+ if (this->ptr) {
579
+ this->drop();
580
+ }
581
+ this->ptr = other.ptr;
582
+ other.ptr = nullptr;
583
+ return *this;
584
+ }
585
+
586
+ template <typename T>
587
+ const T *Box<T>::operator->() const noexcept {
588
+ return this->ptr;
589
+ }
590
+
591
+ template <typename T>
592
+ const T &Box<T>::operator*() const noexcept {
593
+ return *this->ptr;
594
+ }
595
+
596
+ template <typename T>
597
+ T *Box<T>::operator->() noexcept {
598
+ return this->ptr;
599
+ }
600
+
601
+ template <typename T>
602
+ T &Box<T>::operator*() noexcept {
603
+ return *this->ptr;
604
+ }
605
+
606
+ template <typename T>
607
+ template <typename... Fields>
608
+ Box<T> Box<T>::in_place(Fields &&...fields) {
609
+ allocation alloc;
610
+ auto ptr = alloc.ptr;
611
+ ::new (ptr) T{std::forward<Fields>(fields)...};
612
+ alloc.ptr = nullptr;
613
+ return from_raw(ptr);
614
+ }
615
+
616
+ template <typename T>
617
+ void Box<T>::swap(Box &rhs) noexcept {
618
+ using std::swap;
619
+ swap(this->ptr, rhs.ptr);
620
+ }
621
+
622
+ template <typename T>
623
+ Box<T> Box<T>::from_raw(T *raw) noexcept {
624
+ Box box = uninit{};
625
+ box.ptr = raw;
626
+ return box;
627
+ }
628
+
629
+ template <typename T>
630
+ T *Box<T>::into_raw() noexcept {
631
+ T *raw = this->ptr;
632
+ this->ptr = nullptr;
633
+ return raw;
634
+ }
635
+
636
+ template <typename T>
637
+ Box<T>::Box(uninit) noexcept {}
638
+ #endif // CXXBRIDGE1_RUST_BOX
639
+
640
+ #ifndef CXXBRIDGE1_RUST_BITCOPY_T
641
+ #define CXXBRIDGE1_RUST_BITCOPY_T
642
+ struct unsafe_bitcopy_t final {
643
+ explicit unsafe_bitcopy_t() = default;
644
+ };
645
+ #endif // CXXBRIDGE1_RUST_BITCOPY_T
646
+
647
+ #ifndef CXXBRIDGE1_RUST_VEC
648
+ #define CXXBRIDGE1_RUST_VEC
649
+ template <typename T>
650
+ class Vec final {
651
+ public:
652
+ using value_type = T;
653
+
654
+ Vec() noexcept;
655
+ Vec(std::initializer_list<T>);
656
+ Vec(const Vec &);
657
+ Vec(Vec &&) noexcept;
658
+ ~Vec() noexcept;
659
+
660
+ Vec &operator=(Vec &&) & noexcept;
661
+ Vec &operator=(const Vec &) &;
662
+
663
+ std::size_t size() const noexcept;
664
+ bool empty() const noexcept;
665
+ const T *data() const noexcept;
666
+ T *data() noexcept;
667
+ std::size_t capacity() const noexcept;
668
+
669
+ const T &operator[](std::size_t n) const noexcept;
670
+ const T &at(std::size_t n) const;
671
+ const T &front() const noexcept;
672
+ const T &back() const noexcept;
673
+
674
+ T &operator[](std::size_t n) noexcept;
675
+ T &at(std::size_t n);
676
+ T &front() noexcept;
677
+ T &back() noexcept;
678
+
679
+ void reserve(std::size_t new_cap);
680
+ void push_back(const T &value);
681
+ void push_back(T &&value);
682
+ template <typename... Args>
683
+ void emplace_back(Args &&...args);
684
+ void truncate(std::size_t len);
685
+ void clear();
686
+
687
+ using iterator = typename Slice<T>::iterator;
688
+ iterator begin() noexcept;
689
+ iterator end() noexcept;
690
+
691
+ using const_iterator = typename Slice<const T>::iterator;
692
+ const_iterator begin() const noexcept;
693
+ const_iterator end() const noexcept;
694
+ const_iterator cbegin() const noexcept;
695
+ const_iterator cend() const noexcept;
696
+
697
+ void swap(Vec &) noexcept;
698
+
699
+ Vec(unsafe_bitcopy_t, const Vec &) noexcept;
700
+
701
+ private:
702
+ void reserve_total(std::size_t new_cap) noexcept;
703
+ void set_len(std::size_t len) noexcept;
704
+ void drop() noexcept;
705
+
706
+ friend void swap(Vec &lhs, Vec &rhs) noexcept { lhs.swap(rhs); }
707
+
708
+ std::array<std::uintptr_t, 3> repr;
709
+ };
710
+
711
+ template <typename T>
712
+ Vec<T>::Vec(std::initializer_list<T> init) : Vec{} {
713
+ this->reserve_total(init.size());
714
+ std::move(init.begin(), init.end(), std::back_inserter(*this));
715
+ }
716
+
717
+ template <typename T>
718
+ Vec<T>::Vec(const Vec &other) : Vec() {
719
+ this->reserve_total(other.size());
720
+ std::copy(other.begin(), other.end(), std::back_inserter(*this));
721
+ }
722
+
723
+ template <typename T>
724
+ Vec<T>::Vec(Vec &&other) noexcept : repr(other.repr) {
725
+ new (&other) Vec();
726
+ }
727
+
728
+ template <typename T>
729
+ Vec<T>::~Vec() noexcept {
730
+ this->drop();
731
+ }
732
+
733
+ template <typename T>
734
+ Vec<T> &Vec<T>::operator=(Vec &&other) & noexcept {
735
+ this->drop();
736
+ this->repr = other.repr;
737
+ new (&other) Vec();
738
+ return *this;
739
+ }
740
+
741
+ template <typename T>
742
+ Vec<T> &Vec<T>::operator=(const Vec &other) & {
743
+ if (this != &other) {
744
+ this->drop();
745
+ new (this) Vec(other);
746
+ }
747
+ return *this;
748
+ }
749
+
750
+ template <typename T>
751
+ bool Vec<T>::empty() const noexcept {
752
+ return this->size() == 0;
753
+ }
754
+
755
+ template <typename T>
756
+ T *Vec<T>::data() noexcept {
757
+ return const_cast<T *>(const_cast<const Vec<T> *>(this)->data());
758
+ }
759
+
760
+ template <typename T>
761
+ const T &Vec<T>::operator[](std::size_t n) const noexcept {
762
+ assert(n < this->size());
763
+ auto data = reinterpret_cast<const char *>(this->data());
764
+ return *reinterpret_cast<const T *>(data + n * size_of<T>());
765
+ }
766
+
767
+ template <typename T>
768
+ const T &Vec<T>::at(std::size_t n) const {
769
+ if (n >= this->size()) {
770
+ panic<std::out_of_range>("rust::Vec index out of range");
771
+ }
772
+ return (*this)[n];
773
+ }
774
+
775
+ template <typename T>
776
+ const T &Vec<T>::front() const noexcept {
777
+ assert(!this->empty());
778
+ return (*this)[0];
779
+ }
780
+
781
+ template <typename T>
782
+ const T &Vec<T>::back() const noexcept {
783
+ assert(!this->empty());
784
+ return (*this)[this->size() - 1];
785
+ }
786
+
787
+ template <typename T>
788
+ T &Vec<T>::operator[](std::size_t n) noexcept {
789
+ assert(n < this->size());
790
+ auto data = reinterpret_cast<char *>(this->data());
791
+ return *reinterpret_cast<T *>(data + n * size_of<T>());
792
+ }
793
+
794
+ template <typename T>
795
+ T &Vec<T>::at(std::size_t n) {
796
+ if (n >= this->size()) {
797
+ panic<std::out_of_range>("rust::Vec index out of range");
798
+ }
799
+ return (*this)[n];
800
+ }
801
+
802
+ template <typename T>
803
+ T &Vec<T>::front() noexcept {
804
+ assert(!this->empty());
805
+ return (*this)[0];
806
+ }
807
+
808
+ template <typename T>
809
+ T &Vec<T>::back() noexcept {
810
+ assert(!this->empty());
811
+ return (*this)[this->size() - 1];
812
+ }
813
+
814
+ template <typename T>
815
+ void Vec<T>::reserve(std::size_t new_cap) {
816
+ this->reserve_total(new_cap);
817
+ }
818
+
819
+ template <typename T>
820
+ void Vec<T>::push_back(const T &value) {
821
+ this->emplace_back(value);
822
+ }
823
+
824
+ template <typename T>
825
+ void Vec<T>::push_back(T &&value) {
826
+ this->emplace_back(std::move(value));
827
+ }
828
+
829
+ template <typename T>
830
+ template <typename... Args>
831
+ void Vec<T>::emplace_back(Args &&...args) {
832
+ auto size = this->size();
833
+ this->reserve_total(size + 1);
834
+ ::new (reinterpret_cast<T *>(reinterpret_cast<char *>(this->data()) +
835
+ size * size_of<T>()))
836
+ T(std::forward<Args>(args)...);
837
+ this->set_len(size + 1);
838
+ }
839
+
840
+ template <typename T>
841
+ void Vec<T>::clear() {
842
+ this->truncate(0);
843
+ }
844
+
845
+ template <typename T>
846
+ typename Vec<T>::iterator Vec<T>::begin() noexcept {
847
+ return Slice<T>(this->data(), this->size()).begin();
848
+ }
849
+
850
+ template <typename T>
851
+ typename Vec<T>::iterator Vec<T>::end() noexcept {
852
+ return Slice<T>(this->data(), this->size()).end();
853
+ }
854
+
855
+ template <typename T>
856
+ typename Vec<T>::const_iterator Vec<T>::begin() const noexcept {
857
+ return this->cbegin();
858
+ }
859
+
860
+ template <typename T>
861
+ typename Vec<T>::const_iterator Vec<T>::end() const noexcept {
862
+ return this->cend();
863
+ }
864
+
865
+ template <typename T>
866
+ typename Vec<T>::const_iterator Vec<T>::cbegin() const noexcept {
867
+ return Slice<const T>(this->data(), this->size()).begin();
868
+ }
869
+
870
+ template <typename T>
871
+ typename Vec<T>::const_iterator Vec<T>::cend() const noexcept {
872
+ return Slice<const T>(this->data(), this->size()).end();
873
+ }
874
+
875
+ template <typename T>
876
+ void Vec<T>::swap(Vec &rhs) noexcept {
877
+ using std::swap;
878
+ swap(this->repr, rhs.repr);
879
+ }
880
+
881
+ template <typename T>
882
+ Vec<T>::Vec(unsafe_bitcopy_t, const Vec &bits) noexcept : repr(bits.repr) {}
883
+ #endif // CXXBRIDGE1_RUST_VEC
884
+
885
+ #ifndef CXXBRIDGE1_RUST_ERROR
886
+ #define CXXBRIDGE1_RUST_ERROR
887
+ class Error final : public std::exception {
888
+ public:
889
+ Error(const Error &);
890
+ Error(Error &&) noexcept;
891
+ ~Error() noexcept override;
892
+
893
+ Error &operator=(const Error &) &;
894
+ Error &operator=(Error &&) & noexcept;
895
+
896
+ const char *what() const noexcept override;
897
+
898
+ private:
899
+ Error() noexcept = default;
900
+ friend impl<Error>;
901
+ const char *msg;
902
+ std::size_t len;
903
+ };
904
+ #endif // CXXBRIDGE1_RUST_ERROR
905
+
906
+ #ifndef CXXBRIDGE1_RUST_OPAQUE
907
+ #define CXXBRIDGE1_RUST_OPAQUE
908
+ class Opaque {
909
+ public:
910
+ Opaque() = delete;
911
+ Opaque(const Opaque &) = delete;
912
+ ~Opaque() = delete;
913
+ };
914
+ #endif // CXXBRIDGE1_RUST_OPAQUE
915
+
916
+ #ifndef CXXBRIDGE1_IS_COMPLETE
917
+ #define CXXBRIDGE1_IS_COMPLETE
918
+ namespace detail {
919
+ namespace {
920
+ template <typename T, typename = std::size_t>
921
+ struct is_complete : std::false_type {};
922
+ template <typename T>
923
+ struct is_complete<T, decltype(sizeof(T))> : std::true_type {};
924
+ } // namespace
925
+ } // namespace detail
926
+ #endif // CXXBRIDGE1_IS_COMPLETE
927
+
928
+ #ifndef CXXBRIDGE1_LAYOUT
929
+ #define CXXBRIDGE1_LAYOUT
930
+ class layout {
931
+ template <typename T>
932
+ friend std::size_t size_of();
933
+ template <typename T>
934
+ friend std::size_t align_of();
935
+ template <typename T>
936
+ static typename std::enable_if<std::is_base_of<Opaque, T>::value,
937
+ std::size_t>::type
938
+ do_size_of() {
939
+ return T::layout::size();
940
+ }
941
+ template <typename T>
942
+ static typename std::enable_if<!std::is_base_of<Opaque, T>::value,
943
+ std::size_t>::type
944
+ do_size_of() {
945
+ return sizeof(T);
946
+ }
947
+ template <typename T>
948
+ static
949
+ typename std::enable_if<detail::is_complete<T>::value, std::size_t>::type
950
+ size_of() {
951
+ return do_size_of<T>();
952
+ }
953
+ template <typename T>
954
+ static typename std::enable_if<std::is_base_of<Opaque, T>::value,
955
+ std::size_t>::type
956
+ do_align_of() {
957
+ return T::layout::align();
958
+ }
959
+ template <typename T>
960
+ static typename std::enable_if<!std::is_base_of<Opaque, T>::value,
961
+ std::size_t>::type
962
+ do_align_of() {
963
+ return alignof(T);
964
+ }
965
+ template <typename T>
966
+ static
967
+ typename std::enable_if<detail::is_complete<T>::value, std::size_t>::type
968
+ align_of() {
969
+ return do_align_of<T>();
970
+ }
971
+ };
972
+
973
+ template <typename T>
974
+ std::size_t size_of() {
975
+ return layout::size_of<T>();
976
+ }
977
+
978
+ template <typename T>
979
+ std::size_t align_of() {
980
+ return layout::align_of<T>();
981
+ }
982
+ #endif // CXXBRIDGE1_LAYOUT
983
+
984
+ namespace repr {
985
+ struct PtrLen final {
986
+ void *ptr;
987
+ ::std::size_t len;
988
+ };
989
+ } // namespace repr
990
+
991
+ namespace detail {
992
+ template <typename T, typename = void *>
993
+ struct operator_new {
994
+ void *operator()(::std::size_t sz) { return ::operator new(sz); }
995
+ };
996
+
997
+ template <typename T>
998
+ struct operator_new<T, decltype(T::operator new(sizeof(T)))> {
999
+ void *operator()(::std::size_t sz) { return T::operator new(sz); }
1000
+ };
1001
+ } // namespace detail
1002
+
1003
+ template <typename T>
1004
+ union ManuallyDrop {
1005
+ T value;
1006
+ ManuallyDrop(T &&value) : value(::std::move(value)) {}
1007
+ ~ManuallyDrop() {}
1008
+ };
1009
+
1010
+ template <typename T>
1011
+ union MaybeUninit {
1012
+ T value;
1013
+ void *operator new(::std::size_t sz) { return detail::operator_new<T>{}(sz); }
1014
+ MaybeUninit() {}
1015
+ ~MaybeUninit() {}
1016
+ };
1017
+
1018
+ namespace {
1019
+ template <>
1020
+ class impl<Error> final {
1021
+ public:
1022
+ static Error error(repr::PtrLen repr) noexcept {
1023
+ Error error;
1024
+ error.msg = static_cast<char const *>(repr.ptr);
1025
+ error.len = repr.len;
1026
+ return error;
1027
+ }
1028
+ };
1029
+ } // namespace
1030
+ } // namespace cxxbridge1
1031
+ } // namespace rust
1032
+
1033
+ #if __cplusplus >= 201402L
1034
+ #define CXX_DEFAULT_VALUE(value) = value
1035
+ #else
1036
+ #define CXX_DEFAULT_VALUE(value)
1037
+ #endif
1038
+
1039
+ namespace craby {
1040
+ namespace hwpjs {
1041
+ namespace bridging {
1042
+ struct NullableString;
1043
+ struct ToMarkdownResult;
1044
+ struct ToMarkdownOptions;
1045
+ struct Hwpjs;
1046
+ }
1047
+ }
1048
+ }
1049
+
1050
+ namespace craby {
1051
+ namespace hwpjs {
1052
+ namespace bridging {
1053
+ #ifndef CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$NullableString
1054
+ #define CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$NullableString
1055
+ struct NullableString final {
1056
+ bool null CXX_DEFAULT_VALUE(false);
1057
+ ::rust::String val;
1058
+
1059
+ using IsRelocatable = ::std::true_type;
1060
+ };
1061
+ #endif // CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$NullableString
1062
+
1063
+ #ifndef CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$ToMarkdownResult
1064
+ #define CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$ToMarkdownResult
1065
+ struct ToMarkdownResult final {
1066
+ ::rust::String markdown;
1067
+
1068
+ using IsRelocatable = ::std::true_type;
1069
+ };
1070
+ #endif // CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$ToMarkdownResult
1071
+
1072
+ #ifndef CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$ToMarkdownOptions
1073
+ #define CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$ToMarkdownOptions
1074
+ struct ToMarkdownOptions final {
1075
+ ::craby::hwpjs::bridging::NullableString image_output_dir;
1076
+ ::craby::hwpjs::bridging::NullableString image;
1077
+ bool use_html CXX_DEFAULT_VALUE(false);
1078
+ bool include_version CXX_DEFAULT_VALUE(false);
1079
+ bool include_page_info CXX_DEFAULT_VALUE(false);
1080
+
1081
+ using IsRelocatable = ::std::true_type;
1082
+ };
1083
+ #endif // CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$ToMarkdownOptions
1084
+
1085
+ #ifndef CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$Hwpjs
1086
+ #define CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$Hwpjs
1087
+ struct Hwpjs final : public ::rust::Opaque {
1088
+ ~Hwpjs() = delete;
1089
+
1090
+ private:
1091
+ friend ::rust::layout;
1092
+ struct layout {
1093
+ static ::std::size_t size() noexcept;
1094
+ static ::std::size_t align() noexcept;
1095
+ };
1096
+ };
1097
+ #endif // CXXBRIDGE1_STRUCT_craby$hwpjs$bridging$Hwpjs
1098
+
1099
+ extern "C" {
1100
+ ::std::size_t craby$hwpjs$bridging$cxxbridge1$190$Hwpjs$operator$sizeof() noexcept;
1101
+ ::std::size_t craby$hwpjs$bridging$cxxbridge1$190$Hwpjs$operator$alignof() noexcept;
1102
+
1103
+ ::craby::hwpjs::bridging::Hwpjs *craby$hwpjs$bridging$cxxbridge1$190$create_hwpjs(::std::size_t id, ::rust::Str data_path) noexcept;
1104
+
1105
+ ::rust::repr::PtrLen craby$hwpjs$bridging$cxxbridge1$190$hwpjs_file_header(::craby::hwpjs::bridging::Hwpjs &it_, ::rust::Vec<double> *data, ::rust::String *return$) noexcept;
1106
+
1107
+ ::rust::repr::PtrLen craby$hwpjs$bridging$cxxbridge1$190$hwpjs_to_json(::craby::hwpjs::bridging::Hwpjs &it_, ::rust::Vec<double> *data, ::rust::String *return$) noexcept;
1108
+
1109
+ ::rust::repr::PtrLen craby$hwpjs$bridging$cxxbridge1$190$hwpjs_to_markdown(::craby::hwpjs::bridging::Hwpjs &it_, ::rust::Vec<double> *data, ::craby::hwpjs::bridging::ToMarkdownOptions *options, ::craby::hwpjs::bridging::ToMarkdownResult *return$) noexcept;
1110
+ } // extern "C"
1111
+
1112
+ ::std::size_t Hwpjs::layout::size() noexcept {
1113
+ return craby$hwpjs$bridging$cxxbridge1$190$Hwpjs$operator$sizeof();
1114
+ }
1115
+
1116
+ ::std::size_t Hwpjs::layout::align() noexcept {
1117
+ return craby$hwpjs$bridging$cxxbridge1$190$Hwpjs$operator$alignof();
1118
+ }
1119
+
1120
+ ::rust::Box<::craby::hwpjs::bridging::Hwpjs> createHwpjs(::std::size_t id, ::rust::Str data_path) noexcept {
1121
+ return ::rust::Box<::craby::hwpjs::bridging::Hwpjs>::from_raw(craby$hwpjs$bridging$cxxbridge1$190$create_hwpjs(id, data_path));
1122
+ }
1123
+
1124
+ ::rust::String fileHeader(::craby::hwpjs::bridging::Hwpjs &it_, ::rust::Vec<double> data) {
1125
+ ::rust::ManuallyDrop<::rust::Vec<double>> data$(::std::move(data));
1126
+ ::rust::MaybeUninit<::rust::String> return$;
1127
+ ::rust::repr::PtrLen error$ = craby$hwpjs$bridging$cxxbridge1$190$hwpjs_file_header(it_, &data$.value, &return$.value);
1128
+ if (error$.ptr) {
1129
+ throw ::rust::impl<::rust::Error>::error(error$);
1130
+ }
1131
+ return ::std::move(return$.value);
1132
+ }
1133
+
1134
+ ::rust::String toJson(::craby::hwpjs::bridging::Hwpjs &it_, ::rust::Vec<double> data) {
1135
+ ::rust::ManuallyDrop<::rust::Vec<double>> data$(::std::move(data));
1136
+ ::rust::MaybeUninit<::rust::String> return$;
1137
+ ::rust::repr::PtrLen error$ = craby$hwpjs$bridging$cxxbridge1$190$hwpjs_to_json(it_, &data$.value, &return$.value);
1138
+ if (error$.ptr) {
1139
+ throw ::rust::impl<::rust::Error>::error(error$);
1140
+ }
1141
+ return ::std::move(return$.value);
1142
+ }
1143
+
1144
+ ::craby::hwpjs::bridging::ToMarkdownResult toMarkdown(::craby::hwpjs::bridging::Hwpjs &it_, ::rust::Vec<double> data, ::craby::hwpjs::bridging::ToMarkdownOptions options) {
1145
+ ::rust::ManuallyDrop<::rust::Vec<double>> data$(::std::move(data));
1146
+ ::rust::ManuallyDrop<::craby::hwpjs::bridging::ToMarkdownOptions> options$(::std::move(options));
1147
+ ::rust::MaybeUninit<::craby::hwpjs::bridging::ToMarkdownResult> return$;
1148
+ ::rust::repr::PtrLen error$ = craby$hwpjs$bridging$cxxbridge1$190$hwpjs_to_markdown(it_, &data$.value, &options$.value, &return$.value);
1149
+ if (error$.ptr) {
1150
+ throw ::rust::impl<::rust::Error>::error(error$);
1151
+ }
1152
+ return ::std::move(return$.value);
1153
+ }
1154
+ } // namespace bridging
1155
+ } // namespace hwpjs
1156
+ } // namespace craby
1157
+
1158
+ extern "C" {
1159
+ ::craby::hwpjs::bridging::Hwpjs *cxxbridge1$box$craby$hwpjs$bridging$Hwpjs$alloc() noexcept;
1160
+ void cxxbridge1$box$craby$hwpjs$bridging$Hwpjs$dealloc(::craby::hwpjs::bridging::Hwpjs *) noexcept;
1161
+ void cxxbridge1$box$craby$hwpjs$bridging$Hwpjs$drop(::rust::Box<::craby::hwpjs::bridging::Hwpjs> *ptr) noexcept;
1162
+ } // extern "C"
1163
+
1164
+ namespace rust {
1165
+ inline namespace cxxbridge1 {
1166
+ template <>
1167
+ ::craby::hwpjs::bridging::Hwpjs *Box<::craby::hwpjs::bridging::Hwpjs>::allocation::alloc() noexcept {
1168
+ return cxxbridge1$box$craby$hwpjs$bridging$Hwpjs$alloc();
1169
+ }
1170
+ template <>
1171
+ void Box<::craby::hwpjs::bridging::Hwpjs>::allocation::dealloc(::craby::hwpjs::bridging::Hwpjs *ptr) noexcept {
1172
+ cxxbridge1$box$craby$hwpjs$bridging$Hwpjs$dealloc(ptr);
1173
+ }
1174
+ template <>
1175
+ void Box<::craby::hwpjs::bridging::Hwpjs>::drop() noexcept {
1176
+ cxxbridge1$box$craby$hwpjs$bridging$Hwpjs$drop(this);
1177
+ }
1178
+ } // namespace cxxbridge1
1179
+ } // namespace rust