1 #include "types/bluetooth/uuid.h"
2 #include "src/gatt/ffi/gatt_shim.h"
3 #include "stack/arbiter/acl_arbiter.h"
4 #include <algorithm>
5 #include <array>
6 #include <cassert>
7 #include <cstddef>
8 #include <cstdint>
9 #include <initializer_list>
10 #include <iterator>
11 #include <memory>
12 #include <new>
13 #include <stdexcept>
14 #include <type_traits>
15 #include <utility>
16 
17 namespace rust {
18 inline namespace cxxbridge1 {
19 // #include "rust/cxx.h"
20 
21 #ifndef CXXBRIDGE1_PANIC
22 #define CXXBRIDGE1_PANIC
23 template <typename Exception>
24 void panic [[noreturn]] (const char *msg);
25 #endif // CXXBRIDGE1_PANIC
26 
27 namespace {
28 template <typename T>
29 class impl;
30 } // namespace
31 
32 class Opaque;
33 
34 template <typename T>
35 ::std::size_t size_of();
36 template <typename T>
37 ::std::size_t align_of();
38 
39 #ifndef CXXBRIDGE1_RUST_SLICE
40 #define CXXBRIDGE1_RUST_SLICE
41 namespace detail {
42 template <bool>
43 struct copy_assignable_if {};
44 
45 template <>
46 struct copy_assignable_if<false> {
47   copy_assignable_if() noexcept = default;
48   copy_assignable_if(const copy_assignable_if &) noexcept = default;
49   copy_assignable_if &operator=(const copy_assignable_if &) &noexcept = delete;
50   copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default;
51 };
52 } // namespace detail
53 
54 template <typename T>
55 class Slice final
56     : private detail::copy_assignable_if<std::is_const<T>::value> {
57 public:
58   using value_type = T;
59 
60   Slice() noexcept;
61   Slice(T *, std::size_t count) noexcept;
62 
63   Slice &operator=(const Slice<T> &) &noexcept = default;
64   Slice &operator=(Slice<T> &&) &noexcept = default;
65 
66   T *data() const noexcept;
67   std::size_t size() const noexcept;
68   std::size_t length() const noexcept;
69   bool empty() const noexcept;
70 
71   T &operator[](std::size_t n) const noexcept;
72   T &at(std::size_t n) const;
73   T &front() const noexcept;
74   T &back() const noexcept;
75 
76   Slice(const Slice<T> &) noexcept = default;
77   ~Slice() noexcept = default;
78 
79   class iterator;
80   iterator begin() const noexcept;
81   iterator end() const noexcept;
82 
83   void swap(Slice &) noexcept;
84 
85 private:
86   class uninit;
87   Slice(uninit) noexcept;
88   friend impl<Slice>;
89   friend void sliceInit(void *, const void *, std::size_t) noexcept;
90   friend void *slicePtr(const void *) noexcept;
91   friend std::size_t sliceLen(const void *) noexcept;
92 
93   std::array<std::uintptr_t, 2> repr;
94 };
95 
96 template <typename T>
97 class Slice<T>::iterator final {
98 public:
99   using iterator_category = std::random_access_iterator_tag;
100   using value_type = T;
101   using difference_type = std::ptrdiff_t;
102   using pointer = typename std::add_pointer<T>::type;
103   using reference = typename std::add_lvalue_reference<T>::type;
104 
105   reference operator*() const noexcept;
106   pointer operator->() const noexcept;
107   reference operator[](difference_type) const noexcept;
108 
109   iterator &operator++() noexcept;
110   iterator operator++(int) noexcept;
111   iterator &operator--() noexcept;
112   iterator operator--(int) noexcept;
113 
114   iterator &operator+=(difference_type) noexcept;
115   iterator &operator-=(difference_type) noexcept;
116   iterator operator+(difference_type) const noexcept;
117   iterator operator-(difference_type) const noexcept;
118   difference_type operator-(const iterator &) const noexcept;
119 
120   bool operator==(const iterator &) const noexcept;
121   bool operator!=(const iterator &) const noexcept;
122   bool operator<(const iterator &) const noexcept;
123   bool operator<=(const iterator &) const noexcept;
124   bool operator>(const iterator &) const noexcept;
125   bool operator>=(const iterator &) const noexcept;
126 
127 private:
128   friend class Slice;
129   void *pos;
130   std::size_t stride;
131 };
132 
133 template <typename T>
Slice()134 Slice<T>::Slice() noexcept {
135   sliceInit(this, reinterpret_cast<void *>(align_of<T>()), 0);
136 }
137 
138 template <typename T>
Slice(T * s,std::size_t count)139 Slice<T>::Slice(T *s, std::size_t count) noexcept {
140   assert(s != nullptr || count == 0);
141   sliceInit(this,
142             s == nullptr && count == 0
143                 ? reinterpret_cast<void *>(align_of<T>())
144                 : const_cast<typename std::remove_const<T>::type *>(s),
145             count);
146 }
147 
148 template <typename T>
data() const149 T *Slice<T>::data() const noexcept {
150   return reinterpret_cast<T *>(slicePtr(this));
151 }
152 
153 template <typename T>
size() const154 std::size_t Slice<T>::size() const noexcept {
155   return sliceLen(this);
156 }
157 
158 template <typename T>
length() const159 std::size_t Slice<T>::length() const noexcept {
160   return this->size();
161 }
162 
163 template <typename T>
empty() const164 bool Slice<T>::empty() const noexcept {
165   return this->size() == 0;
166 }
167 
168 template <typename T>
operator [](std::size_t n) const169 T &Slice<T>::operator[](std::size_t n) const noexcept {
170   assert(n < this->size());
171   auto ptr = static_cast<char *>(slicePtr(this)) + size_of<T>() * n;
172   return *reinterpret_cast<T *>(ptr);
173 }
174 
175 template <typename T>
at(std::size_t n) const176 T &Slice<T>::at(std::size_t n) const {
177   if (n >= this->size()) {
178     panic<std::out_of_range>("rust::Slice index out of range");
179   }
180   return (*this)[n];
181 }
182 
183 template <typename T>
front() const184 T &Slice<T>::front() const noexcept {
185   assert(!this->empty());
186   return (*this)[0];
187 }
188 
189 template <typename T>
back() const190 T &Slice<T>::back() const noexcept {
191   assert(!this->empty());
192   return (*this)[this->size() - 1];
193 }
194 
195 template <typename T>
196 typename Slice<T>::iterator::reference
operator *() const197 Slice<T>::iterator::operator*() const noexcept {
198   return *static_cast<T *>(this->pos);
199 }
200 
201 template <typename T>
202 typename Slice<T>::iterator::pointer
operator ->() const203 Slice<T>::iterator::operator->() const noexcept {
204   return static_cast<T *>(this->pos);
205 }
206 
207 template <typename T>
operator [](typename Slice<T>::iterator::difference_type n) const208 typename Slice<T>::iterator::reference Slice<T>::iterator::operator[](
209     typename Slice<T>::iterator::difference_type n) const noexcept {
210   auto ptr = static_cast<char *>(this->pos) + this->stride * n;
211   return *reinterpret_cast<T *>(ptr);
212 }
213 
214 template <typename T>
operator ++()215 typename Slice<T>::iterator &Slice<T>::iterator::operator++() noexcept {
216   this->pos = static_cast<char *>(this->pos) + this->stride;
217   return *this;
218 }
219 
220 template <typename T>
operator ++(int)221 typename Slice<T>::iterator Slice<T>::iterator::operator++(int) noexcept {
222   auto ret = iterator(*this);
223   this->pos = static_cast<char *>(this->pos) + this->stride;
224   return ret;
225 }
226 
227 template <typename T>
operator --()228 typename Slice<T>::iterator &Slice<T>::iterator::operator--() noexcept {
229   this->pos = static_cast<char *>(this->pos) - this->stride;
230   return *this;
231 }
232 
233 template <typename T>
operator --(int)234 typename Slice<T>::iterator Slice<T>::iterator::operator--(int) noexcept {
235   auto ret = iterator(*this);
236   this->pos = static_cast<char *>(this->pos) - this->stride;
237   return ret;
238 }
239 
240 template <typename T>
operator +=(typename Slice<T>::iterator::difference_type n)241 typename Slice<T>::iterator &Slice<T>::iterator::operator+=(
242     typename Slice<T>::iterator::difference_type n) noexcept {
243   this->pos = static_cast<char *>(this->pos) + this->stride * n;
244   return *this;
245 }
246 
247 template <typename T>
operator -=(typename Slice<T>::iterator::difference_type n)248 typename Slice<T>::iterator &Slice<T>::iterator::operator-=(
249     typename Slice<T>::iterator::difference_type n) noexcept {
250   this->pos = static_cast<char *>(this->pos) - this->stride * n;
251   return *this;
252 }
253 
254 template <typename T>
operator +(typename Slice<T>::iterator::difference_type n) const255 typename Slice<T>::iterator Slice<T>::iterator::operator+(
256     typename Slice<T>::iterator::difference_type n) const noexcept {
257   auto ret = iterator(*this);
258   ret.pos = static_cast<char *>(this->pos) + this->stride * n;
259   return ret;
260 }
261 
262 template <typename T>
operator -(typename Slice<T>::iterator::difference_type n) const263 typename Slice<T>::iterator Slice<T>::iterator::operator-(
264     typename Slice<T>::iterator::difference_type n) const noexcept {
265   auto ret = iterator(*this);
266   ret.pos = static_cast<char *>(this->pos) - this->stride * n;
267   return ret;
268 }
269 
270 template <typename T>
271 typename Slice<T>::iterator::difference_type
operator -(const iterator & other) const272 Slice<T>::iterator::operator-(const iterator &other) const noexcept {
273   auto diff = std::distance(static_cast<char *>(other.pos),
274                             static_cast<char *>(this->pos));
275   return diff / static_cast<typename Slice<T>::iterator::difference_type>(
276                     this->stride);
277 }
278 
279 template <typename T>
operator ==(const iterator & other) const280 bool Slice<T>::iterator::operator==(const iterator &other) const noexcept {
281   return this->pos == other.pos;
282 }
283 
284 template <typename T>
operator !=(const iterator & other) const285 bool Slice<T>::iterator::operator!=(const iterator &other) const noexcept {
286   return this->pos != other.pos;
287 }
288 
289 template <typename T>
operator <(const iterator & other) const290 bool Slice<T>::iterator::operator<(const iterator &other) const noexcept {
291   return this->pos < other.pos;
292 }
293 
294 template <typename T>
operator <=(const iterator & other) const295 bool Slice<T>::iterator::operator<=(const iterator &other) const noexcept {
296   return this->pos <= other.pos;
297 }
298 
299 template <typename T>
operator >(const iterator & other) const300 bool Slice<T>::iterator::operator>(const iterator &other) const noexcept {
301   return this->pos > other.pos;
302 }
303 
304 template <typename T>
operator >=(const iterator & other) const305 bool Slice<T>::iterator::operator>=(const iterator &other) const noexcept {
306   return this->pos >= other.pos;
307 }
308 
309 template <typename T>
begin() const310 typename Slice<T>::iterator Slice<T>::begin() const noexcept {
311   iterator it;
312   it.pos = slicePtr(this);
313   it.stride = size_of<T>();
314   return it;
315 }
316 
317 template <typename T>
end() const318 typename Slice<T>::iterator Slice<T>::end() const noexcept {
319   iterator it = this->begin();
320   it.pos = static_cast<char *>(it.pos) + it.stride * this->size();
321   return it;
322 }
323 
324 template <typename T>
swap(Slice & rhs)325 void Slice<T>::swap(Slice &rhs) noexcept {
326   std::swap(*this, rhs);
327 }
328 #endif // CXXBRIDGE1_RUST_SLICE
329 
330 #ifndef CXXBRIDGE1_RUST_BITCOPY_T
331 #define CXXBRIDGE1_RUST_BITCOPY_T
332 struct unsafe_bitcopy_t final {
333   explicit unsafe_bitcopy_t() = default;
334 };
335 #endif // CXXBRIDGE1_RUST_BITCOPY_T
336 
337 #ifndef CXXBRIDGE1_RUST_BITCOPY
338 #define CXXBRIDGE1_RUST_BITCOPY
339 constexpr unsafe_bitcopy_t unsafe_bitcopy{};
340 #endif // CXXBRIDGE1_RUST_BITCOPY
341 
342 #ifndef CXXBRIDGE1_RUST_VEC
343 #define CXXBRIDGE1_RUST_VEC
344 template <typename T>
345 class Vec final {
346 public:
347   using value_type = T;
348 
349   Vec() noexcept;
350   Vec(std::initializer_list<T>);
351   Vec(const Vec &);
352   Vec(Vec &&) noexcept;
353   ~Vec() noexcept;
354 
355   Vec &operator=(Vec &&) &noexcept;
356   Vec &operator=(const Vec &) &;
357 
358   std::size_t size() const noexcept;
359   bool empty() const noexcept;
360   const T *data() const noexcept;
361   T *data() noexcept;
362   std::size_t capacity() const noexcept;
363 
364   const T &operator[](std::size_t n) const noexcept;
365   const T &at(std::size_t n) const;
366   const T &front() const noexcept;
367   const T &back() const noexcept;
368 
369   T &operator[](std::size_t n) noexcept;
370   T &at(std::size_t n);
371   T &front() noexcept;
372   T &back() noexcept;
373 
374   void reserve(std::size_t new_cap);
375   void push_back(const T &value);
376   void push_back(T &&value);
377   template <typename... Args>
378   void emplace_back(Args &&...args);
379   void truncate(std::size_t len);
380   void clear();
381 
382   using iterator = typename Slice<T>::iterator;
383   iterator begin() noexcept;
384   iterator end() noexcept;
385 
386   using const_iterator = typename Slice<const T>::iterator;
387   const_iterator begin() const noexcept;
388   const_iterator end() const noexcept;
389   const_iterator cbegin() const noexcept;
390   const_iterator cend() const noexcept;
391 
392   void swap(Vec &) noexcept;
393 
394   Vec(unsafe_bitcopy_t, const Vec &) noexcept;
395 
396 private:
397   void reserve_total(std::size_t new_cap) noexcept;
398   void set_len(std::size_t len) noexcept;
399   void drop() noexcept;
400 
swap(Vec & lhs,Vec & rhs)401   friend void swap(Vec &lhs, Vec &rhs) noexcept { lhs.swap(rhs); }
402 
403   std::array<std::uintptr_t, 3> repr;
404 };
405 
406 template <typename T>
Vec(std::initializer_list<T> init)407 Vec<T>::Vec(std::initializer_list<T> init) : Vec{} {
408   this->reserve_total(init.size());
409   std::move(init.begin(), init.end(), std::back_inserter(*this));
410 }
411 
412 template <typename T>
Vec(const Vec & other)413 Vec<T>::Vec(const Vec &other) : Vec() {
414   this->reserve_total(other.size());
415   std::copy(other.begin(), other.end(), std::back_inserter(*this));
416 }
417 
418 template <typename T>
Vec(Vec && other)419 Vec<T>::Vec(Vec &&other) noexcept : repr(other.repr) {
420   new (&other) Vec();
421 }
422 
423 template <typename T>
~Vec()424 Vec<T>::~Vec() noexcept {
425   this->drop();
426 }
427 
428 template <typename T>
operator =(Vec && other)429 Vec<T> &Vec<T>::operator=(Vec &&other) &noexcept {
430   this->drop();
431   this->repr = other.repr;
432   new (&other) Vec();
433   return *this;
434 }
435 
436 template <typename T>
operator =(const Vec & other)437 Vec<T> &Vec<T>::operator=(const Vec &other) & {
438   if (this != &other) {
439     this->drop();
440     new (this) Vec(other);
441   }
442   return *this;
443 }
444 
445 template <typename T>
empty() const446 bool Vec<T>::empty() const noexcept {
447   return this->size() == 0;
448 }
449 
450 template <typename T>
data()451 T *Vec<T>::data() noexcept {
452   return const_cast<T *>(const_cast<const Vec<T> *>(this)->data());
453 }
454 
455 template <typename T>
operator [](std::size_t n) const456 const T &Vec<T>::operator[](std::size_t n) const noexcept {
457   assert(n < this->size());
458   auto data = reinterpret_cast<const char *>(this->data());
459   return *reinterpret_cast<const T *>(data + n * size_of<T>());
460 }
461 
462 template <typename T>
at(std::size_t n) const463 const T &Vec<T>::at(std::size_t n) const {
464   if (n >= this->size()) {
465     panic<std::out_of_range>("rust::Vec index out of range");
466   }
467   return (*this)[n];
468 }
469 
470 template <typename T>
front() const471 const T &Vec<T>::front() const noexcept {
472   assert(!this->empty());
473   return (*this)[0];
474 }
475 
476 template <typename T>
back() const477 const T &Vec<T>::back() const noexcept {
478   assert(!this->empty());
479   return (*this)[this->size() - 1];
480 }
481 
482 template <typename T>
operator [](std::size_t n)483 T &Vec<T>::operator[](std::size_t n) noexcept {
484   assert(n < this->size());
485   auto data = reinterpret_cast<char *>(this->data());
486   return *reinterpret_cast<T *>(data + n * size_of<T>());
487 }
488 
489 template <typename T>
at(std::size_t n)490 T &Vec<T>::at(std::size_t n) {
491   if (n >= this->size()) {
492     panic<std::out_of_range>("rust::Vec index out of range");
493   }
494   return (*this)[n];
495 }
496 
497 template <typename T>
front()498 T &Vec<T>::front() noexcept {
499   assert(!this->empty());
500   return (*this)[0];
501 }
502 
503 template <typename T>
back()504 T &Vec<T>::back() noexcept {
505   assert(!this->empty());
506   return (*this)[this->size() - 1];
507 }
508 
509 template <typename T>
reserve(std::size_t new_cap)510 void Vec<T>::reserve(std::size_t new_cap) {
511   this->reserve_total(new_cap);
512 }
513 
514 template <typename T>
push_back(const T & value)515 void Vec<T>::push_back(const T &value) {
516   this->emplace_back(value);
517 }
518 
519 template <typename T>
push_back(T && value)520 void Vec<T>::push_back(T &&value) {
521   this->emplace_back(std::move(value));
522 }
523 
524 template <typename T>
525 template <typename... Args>
emplace_back(Args &&...args)526 void Vec<T>::emplace_back(Args &&...args) {
527   auto size = this->size();
528   this->reserve_total(size + 1);
529   ::new (reinterpret_cast<T *>(reinterpret_cast<char *>(this->data()) +
530                                size * size_of<T>()))
531       T(std::forward<Args>(args)...);
532   this->set_len(size + 1);
533 }
534 
535 template <typename T>
clear()536 void Vec<T>::clear() {
537   this->truncate(0);
538 }
539 
540 template <typename T>
begin()541 typename Vec<T>::iterator Vec<T>::begin() noexcept {
542   return Slice<T>(this->data(), this->size()).begin();
543 }
544 
545 template <typename T>
end()546 typename Vec<T>::iterator Vec<T>::end() noexcept {
547   return Slice<T>(this->data(), this->size()).end();
548 }
549 
550 template <typename T>
begin() const551 typename Vec<T>::const_iterator Vec<T>::begin() const noexcept {
552   return this->cbegin();
553 }
554 
555 template <typename T>
end() const556 typename Vec<T>::const_iterator Vec<T>::end() const noexcept {
557   return this->cend();
558 }
559 
560 template <typename T>
cbegin() const561 typename Vec<T>::const_iterator Vec<T>::cbegin() const noexcept {
562   return Slice<const T>(this->data(), this->size()).begin();
563 }
564 
565 template <typename T>
cend() const566 typename Vec<T>::const_iterator Vec<T>::cend() const noexcept {
567   return Slice<const T>(this->data(), this->size()).end();
568 }
569 
570 template <typename T>
swap(Vec & rhs)571 void Vec<T>::swap(Vec &rhs) noexcept {
572   using std::swap;
573   swap(this->repr, rhs.repr);
574 }
575 
576 template <typename T>
Vec(unsafe_bitcopy_t,const Vec & bits)577 Vec<T>::Vec(unsafe_bitcopy_t, const Vec &bits) noexcept : repr(bits.repr) {}
578 #endif // CXXBRIDGE1_RUST_VEC
579 
580 #ifndef CXXBRIDGE1_RUST_FN
581 #define CXXBRIDGE1_RUST_FN
582 template <typename Signature>
583 class Fn;
584 
585 template <typename Ret, typename... Args>
586 class Fn<Ret(Args...)> final {
587 public:
588   Ret operator()(Args... args) const noexcept;
589   Fn operator*() const noexcept;
590 
591 private:
592   Ret (*trampoline)(Args..., void *fn) noexcept;
593   void *fn;
594 };
595 
596 template <typename Ret, typename... Args>
operator ()(Args...args) const597 Ret Fn<Ret(Args...)>::operator()(Args... args) const noexcept {
598   return (*this->trampoline)(std::forward<Args>(args)..., this->fn);
599 }
600 
601 template <typename Ret, typename... Args>
operator *() const602 Fn<Ret(Args...)> Fn<Ret(Args...)>::operator*() const noexcept {
603   return *this;
604 }
605 #endif // CXXBRIDGE1_RUST_FN
606 
607 #ifndef CXXBRIDGE1_IS_COMPLETE
608 #define CXXBRIDGE1_IS_COMPLETE
609 namespace detail {
610 namespace {
611 template <typename T, typename = std::size_t>
612 struct is_complete : std::false_type {};
613 template <typename T>
614 struct is_complete<T, decltype(sizeof(T))> : std::true_type {};
615 } // namespace
616 } // namespace detail
617 #endif // CXXBRIDGE1_IS_COMPLETE
618 
619 #ifndef CXXBRIDGE1_LAYOUT
620 #define CXXBRIDGE1_LAYOUT
621 class layout {
622   template <typename T>
623   friend std::size_t size_of();
624   template <typename T>
625   friend std::size_t align_of();
626   template <typename T>
627   static typename std::enable_if<std::is_base_of<Opaque, T>::value,
628                                  std::size_t>::type
do_size_of()629   do_size_of() {
630     return T::layout::size();
631   }
632   template <typename T>
633   static typename std::enable_if<!std::is_base_of<Opaque, T>::value,
634                                  std::size_t>::type
do_size_of()635   do_size_of() {
636     return sizeof(T);
637   }
638   template <typename T>
639   static
640       typename std::enable_if<detail::is_complete<T>::value, std::size_t>::type
size_of()641       size_of() {
642     return do_size_of<T>();
643   }
644   template <typename T>
645   static typename std::enable_if<std::is_base_of<Opaque, T>::value,
646                                  std::size_t>::type
do_align_of()647   do_align_of() {
648     return T::layout::align();
649   }
650   template <typename T>
651   static typename std::enable_if<!std::is_base_of<Opaque, T>::value,
652                                  std::size_t>::type
do_align_of()653   do_align_of() {
654     return alignof(T);
655   }
656   template <typename T>
657   static
658       typename std::enable_if<detail::is_complete<T>::value, std::size_t>::type
align_of()659       align_of() {
660     return do_align_of<T>();
661   }
662 };
663 
664 template <typename T>
size_of()665 std::size_t size_of() {
666   return layout::size_of<T>();
667 }
668 
669 template <typename T>
align_of()670 std::size_t align_of() {
671   return layout::align_of<T>();
672 }
673 #endif // CXXBRIDGE1_LAYOUT
674 
675 #ifndef CXXBRIDGE1_RELOCATABLE
676 #define CXXBRIDGE1_RELOCATABLE
677 namespace detail {
678 template <typename... Ts>
679 struct make_void {
680   using type = void;
681 };
682 
683 template <typename... Ts>
684 using void_t = typename make_void<Ts...>::type;
685 
686 template <typename Void, template <typename...> class, typename...>
687 struct detect : std::false_type {};
688 template <template <typename...> class T, typename... A>
689 struct detect<void_t<T<A...>>, T, A...> : std::true_type {};
690 
691 template <template <typename...> class T, typename... A>
692 using is_detected = detect<void, T, A...>;
693 
694 template <typename T>
695 using detect_IsRelocatable = typename T::IsRelocatable;
696 
697 template <typename T>
698 struct get_IsRelocatable
699     : std::is_same<typename T::IsRelocatable, std::true_type> {};
700 } // namespace detail
701 
702 template <typename T>
703 struct IsRelocatable
704     : std::conditional<
705           detail::is_detected<detail::detect_IsRelocatable, T>::value,
706           detail::get_IsRelocatable<T>,
707           std::integral_constant<
708               bool, std::is_trivially_move_constructible<T>::value &&
709                         std::is_trivially_destructible<T>::value>>::type {};
710 #endif // CXXBRIDGE1_RELOCATABLE
711 
712 template <typename T>
713 union ManuallyDrop {
714   T value;
ManuallyDrop(T && value)715   ManuallyDrop(T &&value) : value(::std::move(value)) {}
~ManuallyDrop()716   ~ManuallyDrop() {}
717 };
718 
719 namespace {
720 template <bool> struct deleter_if {
operator ()rust::cxxbridge1::__anon6d6007280311::deleter_if721   template <typename T> void operator()(T *) {}
722 };
723 
724 template <> struct deleter_if<true> {
operator ()rust::cxxbridge1::__anon6d6007280311::deleter_if725   template <typename T> void operator()(T *ptr) { ptr->~T(); }
726 };
727 
728 template <typename T>
729 struct IsRelocatableOrArray : IsRelocatable<T> {};
730 template <typename T, ::std::size_t N>
731 struct IsRelocatableOrArray<T[N]> : IsRelocatableOrArray<T> {};
732 } // namespace
733 } // namespace cxxbridge1
734 } // namespace rust
735 
736 namespace bluetooth {
737   namespace gatt {
738     using AttributeBackingType = ::bluetooth::gatt::AttributeBackingType;
739     using GattServerCallbacks = ::bluetooth::gatt::GattServerCallbacks;
740     enum class GattRecordType : ::std::uint8_t;
741     struct GattRecord;
742   }
743   namespace shim {
744     namespace arbiter {
745       using InterceptAction = ::bluetooth::shim::arbiter::InterceptAction;
746     }
747   }
748 }
749 
750 namespace bluetooth {
751 namespace gatt {
752 static_assert(::std::is_enum<AttributeBackingType>::value, "expected enum");
753 static_assert(sizeof(AttributeBackingType) == sizeof(::std::uint32_t), "incorrect size");
754 static_assert(static_cast<::std::uint32_t>(AttributeBackingType::CHARACTERISTIC) == 0, "disagrees with the value in #[cxx::bridge]");
755 static_assert(static_cast<::std::uint32_t>(AttributeBackingType::DESCRIPTOR) == 1, "disagrees with the value in #[cxx::bridge]");
756 } // namespace gatt
757 
758 namespace shim {
759 namespace arbiter {
760 static_assert(::std::is_enum<InterceptAction>::value, "expected enum");
761 static_assert(sizeof(InterceptAction) == sizeof(::std::uint32_t), "incorrect size");
762 static_assert(static_cast<::std::uint32_t>(InterceptAction::FORWARD) == 0, "disagrees with the value in #[cxx::bridge]");
763 static_assert(static_cast<::std::uint32_t>(InterceptAction::DROP) == 1, "disagrees with the value in #[cxx::bridge]");
764 } // namespace arbiter
765 } // namespace shim
766 
767 namespace gatt {
768 #ifndef CXXBRIDGE1_ENUM_bluetooth$gatt$GattRecordType
769 #define CXXBRIDGE1_ENUM_bluetooth$gatt$GattRecordType
770 // The type of GATT record supplied over FFI
771 enum class GattRecordType : ::std::uint8_t {
772   PrimaryService = 0,
773   SecondaryService = 1,
774   IncludedService = 2,
775   Characteristic = 3,
776   Descriptor = 4,
777 };
778 #endif // CXXBRIDGE1_ENUM_bluetooth$gatt$GattRecordType
779 
780 #ifndef CXXBRIDGE1_STRUCT_bluetooth$gatt$GattRecord
781 #define CXXBRIDGE1_STRUCT_bluetooth$gatt$GattRecord
782 // An entry in a service definition received from JNI. See GattRecordType
783 // for possible types.
784 struct GattRecord final {
785   ::bluetooth::Uuid uuid;
786   ::bluetooth::gatt::GattRecordType record_type;
787   ::std::uint16_t attribute_handle;
788   ::std::uint8_t properties;
789   ::std::uint16_t extended_properties;
790   ::std::uint16_t permissions;
791 
792   using IsRelocatable = ::std::true_type;
793 };
794 #endif // CXXBRIDGE1_STRUCT_bluetooth$gatt$GattRecord
795 } // namespace gatt
796 } // namespace bluetooth
797 
798 static_assert(
799     ::rust::IsRelocatableOrArray<::bluetooth::Uuid>::value,
800     "type bluetooth::Uuid should be trivially move constructible and trivially destructible in C++ to be used as a field of `GattRecord` in Rust");
801 
802 namespace bluetooth {
803 namespace gatt {
804 extern "C" {
bluetooth$gatt$cxxbridge1$GattServerCallbacks$on_server_read(::bluetooth::gatt::GattServerCallbacks const & self,::std::uint16_t conn_id,::std::uint32_t trans_id,::std::uint16_t attr_handle,::bluetooth::gatt::AttributeBackingType attr_type,::std::uint32_t offset,bool is_long)805 void bluetooth$gatt$cxxbridge1$GattServerCallbacks$on_server_read(::bluetooth::gatt::GattServerCallbacks const &self, ::std::uint16_t conn_id, ::std::uint32_t trans_id, ::std::uint16_t attr_handle, ::bluetooth::gatt::AttributeBackingType attr_type, ::std::uint32_t offset, bool is_long) noexcept {
806   void (::bluetooth::gatt::GattServerCallbacks::*on_server_read$)(::std::uint16_t, ::std::uint32_t, ::std::uint16_t, ::bluetooth::gatt::AttributeBackingType, ::std::uint32_t, bool) const = &::bluetooth::gatt::GattServerCallbacks::OnServerRead;
807   (self.*on_server_read$)(conn_id, trans_id, attr_handle, attr_type, offset, is_long);
808 }
809 
bluetooth$gatt$cxxbridge1$GattServerCallbacks$on_server_write(::bluetooth::gatt::GattServerCallbacks const & self,::std::uint16_t conn_id,::std::uint32_t trans_id,::std::uint16_t attr_handle,::bluetooth::gatt::AttributeBackingType attr_type,::std::uint32_t offset,bool need_response,bool is_prepare,::rust::Slice<::std::uint8_t const> value)810 void bluetooth$gatt$cxxbridge1$GattServerCallbacks$on_server_write(::bluetooth::gatt::GattServerCallbacks const &self, ::std::uint16_t conn_id, ::std::uint32_t trans_id, ::std::uint16_t attr_handle, ::bluetooth::gatt::AttributeBackingType attr_type, ::std::uint32_t offset, bool need_response, bool is_prepare, ::rust::Slice<::std::uint8_t const> value) noexcept {
811   void (::bluetooth::gatt::GattServerCallbacks::*on_server_write$)(::std::uint16_t, ::std::uint32_t, ::std::uint16_t, ::bluetooth::gatt::AttributeBackingType, ::std::uint32_t, bool, bool, ::rust::Slice<::std::uint8_t const>) const = &::bluetooth::gatt::GattServerCallbacks::OnServerWrite;
812   (self.*on_server_write$)(conn_id, trans_id, attr_handle, attr_type, offset, need_response, is_prepare, value);
813 }
814 
bluetooth$gatt$cxxbridge1$GattServerCallbacks$on_execute(::bluetooth::gatt::GattServerCallbacks const & self,::std::uint16_t conn_id,::std::uint32_t trans_id,bool execute)815 void bluetooth$gatt$cxxbridge1$GattServerCallbacks$on_execute(::bluetooth::gatt::GattServerCallbacks const &self, ::std::uint16_t conn_id, ::std::uint32_t trans_id, bool execute) noexcept {
816   void (::bluetooth::gatt::GattServerCallbacks::*on_execute$)(::std::uint16_t, ::std::uint32_t, bool) const = &::bluetooth::gatt::GattServerCallbacks::OnExecute;
817   (self.*on_execute$)(conn_id, trans_id, execute);
818 }
819 
bluetooth$gatt$cxxbridge1$GattServerCallbacks$on_indication_sent_confirmation(::bluetooth::gatt::GattServerCallbacks const & self,::std::uint16_t conn_id,::std::int32_t status)820 void bluetooth$gatt$cxxbridge1$GattServerCallbacks$on_indication_sent_confirmation(::bluetooth::gatt::GattServerCallbacks const &self, ::std::uint16_t conn_id, ::std::int32_t status) noexcept {
821   void (::bluetooth::gatt::GattServerCallbacks::*on_indication_sent_confirmation$)(::std::uint16_t, ::std::int32_t) const = &::bluetooth::gatt::GattServerCallbacks::OnIndicationSentConfirmation;
822   (self.*on_indication_sent_confirmation$)(conn_id, status);
823 }
824 } // extern "C"
825 } // namespace gatt
826 
827 namespace shim {
828 namespace arbiter {
829 extern "C" {
bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust(::rust::Fn<void (::std::uint8_t,::std::uint8_t)> on_le_connect,::rust::Fn<void (::std::uint8_t)> on_le_disconnect,::rust::Fn<::bluetooth::shim::arbiter::InterceptAction (::std::uint8_t,::rust::Vec<::std::uint8_t>)> intercept_packet,::rust::Fn<void (::std::uint8_t)> on_outgoing_mtu_req,::rust::Fn<void (::std::uint8_t,::std::size_t)> on_incoming_mtu_resp,::rust::Fn<void (::std::uint8_t,::std::size_t)> on_incoming_mtu_req)830 void bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust(::rust::Fn<void(::std::uint8_t, ::std::uint8_t)> on_le_connect, ::rust::Fn<void(::std::uint8_t)> on_le_disconnect, ::rust::Fn<::bluetooth::shim::arbiter::InterceptAction(::std::uint8_t, ::rust::Vec<::std::uint8_t>)> intercept_packet, ::rust::Fn<void(::std::uint8_t)> on_outgoing_mtu_req, ::rust::Fn<void(::std::uint8_t, ::std::size_t)> on_incoming_mtu_resp, ::rust::Fn<void(::std::uint8_t, ::std::size_t)> on_incoming_mtu_req) noexcept {
831   void (*StoreCallbacksFromRust$)(::rust::Fn<void(::std::uint8_t, ::std::uint8_t)>, ::rust::Fn<void(::std::uint8_t)>, ::rust::Fn<::bluetooth::shim::arbiter::InterceptAction(::std::uint8_t, ::rust::Vec<::std::uint8_t>)>, ::rust::Fn<void(::std::uint8_t)>, ::rust::Fn<void(::std::uint8_t, ::std::size_t)>, ::rust::Fn<void(::std::uint8_t, ::std::size_t)>) = ::bluetooth::shim::arbiter::StoreCallbacksFromRust;
832   StoreCallbacksFromRust$(on_le_connect, on_le_disconnect, intercept_packet, on_outgoing_mtu_req, on_incoming_mtu_resp, on_incoming_mtu_req);
833 }
834 
835 void bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_le_connect$1(::std::uint8_t tcb_idx, ::std::uint8_t advertiser, void *) noexcept;
836 
bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_le_connect$0(::std::uint8_t tcb_idx,::std::uint8_t advertiser,void * extern$)837 void bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_le_connect$0(::std::uint8_t tcb_idx, ::std::uint8_t advertiser, void *extern$) noexcept {
838   bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_le_connect$1(tcb_idx, advertiser, extern$);
839 }
840 
841 void bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_le_disconnect$1(::std::uint8_t tcb_idx, void *) noexcept;
842 
bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_le_disconnect$0(::std::uint8_t tcb_idx,void * extern$)843 void bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_le_disconnect$0(::std::uint8_t tcb_idx, void *extern$) noexcept {
844   bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_le_disconnect$1(tcb_idx, extern$);
845 }
846 
847 ::bluetooth::shim::arbiter::InterceptAction bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$intercept_packet$1(::std::uint8_t tcb_idx, ::rust::Vec<::std::uint8_t> *packet, void *) noexcept;
848 
bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$intercept_packet$0(::std::uint8_t tcb_idx,::rust::Vec<::std::uint8_t> packet,void * extern$)849 ::bluetooth::shim::arbiter::InterceptAction bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$intercept_packet$0(::std::uint8_t tcb_idx, ::rust::Vec<::std::uint8_t> packet, void *extern$) noexcept {
850   ::rust::ManuallyDrop<::rust::Vec<::std::uint8_t>> packet$(::std::move(packet));
851   return bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$intercept_packet$1(tcb_idx, &packet$.value, extern$);
852 }
853 
854 void bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_outgoing_mtu_req$1(::std::uint8_t tcb_idx, void *) noexcept;
855 
bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_outgoing_mtu_req$0(::std::uint8_t tcb_idx,void * extern$)856 void bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_outgoing_mtu_req$0(::std::uint8_t tcb_idx, void *extern$) noexcept {
857   bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_outgoing_mtu_req$1(tcb_idx, extern$);
858 }
859 
860 void bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_incoming_mtu_resp$1(::std::uint8_t tcb_idx, ::std::size_t mtu, void *) noexcept;
861 
bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_incoming_mtu_resp$0(::std::uint8_t tcb_idx,::std::size_t mtu,void * extern$)862 void bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_incoming_mtu_resp$0(::std::uint8_t tcb_idx, ::std::size_t mtu, void *extern$) noexcept {
863   bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_incoming_mtu_resp$1(tcb_idx, mtu, extern$);
864 }
865 
866 void bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_incoming_mtu_req$1(::std::uint8_t tcb_idx, ::std::size_t mtu, void *) noexcept;
867 
bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_incoming_mtu_req$0(::std::uint8_t tcb_idx,::std::size_t mtu,void * extern$)868 void bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_incoming_mtu_req$0(::std::uint8_t tcb_idx, ::std::size_t mtu, void *extern$) noexcept {
869   bluetooth$shim$arbiter$cxxbridge1$StoreCallbacksFromRust$on_incoming_mtu_req$1(tcb_idx, mtu, extern$);
870 }
871 
bluetooth$shim$arbiter$cxxbridge1$SendPacketToPeer(::std::uint8_t tcb_idx,::rust::Vec<::std::uint8_t> const * packet)872 void bluetooth$shim$arbiter$cxxbridge1$SendPacketToPeer(::std::uint8_t tcb_idx, ::rust::Vec<::std::uint8_t> const *packet) noexcept {
873   void (*SendPacketToPeer$)(::std::uint8_t, ::rust::Vec<::std::uint8_t>) = ::bluetooth::shim::arbiter::SendPacketToPeer;
874   SendPacketToPeer$(tcb_idx, ::rust::Vec<::std::uint8_t>(::rust::unsafe_bitcopy, *packet));
875 }
876 } // extern "C"
877 } // namespace arbiter
878 } // namespace shim
879 
880 namespace gatt {
881 extern "C" {
882 void bluetooth$gatt$cxxbridge1$open_server(::std::uint8_t server_id) noexcept;
883 
884 void bluetooth$gatt$cxxbridge1$close_server(::std::uint8_t server_id) noexcept;
885 
886 void bluetooth$gatt$cxxbridge1$add_service(::std::uint8_t server_id, ::rust::Vec<::bluetooth::gatt::GattRecord> *service_records) noexcept;
887 
888 void bluetooth$gatt$cxxbridge1$remove_service(::std::uint8_t server_id, ::std::uint16_t service_handle) noexcept;
889 
890 void bluetooth$gatt$cxxbridge1$send_response(::std::uint8_t server_id, ::std::uint16_t conn_id, ::std::uint32_t trans_id, ::std::uint8_t status, ::rust::Slice<::std::uint8_t const> value) noexcept;
891 
892 void bluetooth$gatt$cxxbridge1$send_indication(::std::uint8_t _server_id, ::std::uint16_t handle, ::std::uint16_t conn_id, ::rust::Slice<::std::uint8_t const> value) noexcept;
893 
894 bool bluetooth$gatt$cxxbridge1$is_connection_isolated(::std::uint16_t conn_id) noexcept;
895 
896 void bluetooth$gatt$cxxbridge1$associate_server_with_advertiser(::std::uint8_t server_id, ::std::uint8_t advertiser_id) noexcept;
897 
898 void bluetooth$gatt$cxxbridge1$clear_advertiser(::std::uint8_t advertiser_id) noexcept;
899 } // extern "C"
900 
open_server(::std::uint8_t server_id)901 void open_server(::std::uint8_t server_id) noexcept {
902   bluetooth$gatt$cxxbridge1$open_server(server_id);
903 }
904 
close_server(::std::uint8_t server_id)905 void close_server(::std::uint8_t server_id) noexcept {
906   bluetooth$gatt$cxxbridge1$close_server(server_id);
907 }
908 
add_service(::std::uint8_t server_id,::rust::Vec<::bluetooth::gatt::GattRecord> service_records)909 void add_service(::std::uint8_t server_id, ::rust::Vec<::bluetooth::gatt::GattRecord> service_records) noexcept {
910   ::rust::ManuallyDrop<::rust::Vec<::bluetooth::gatt::GattRecord>> service_records$(::std::move(service_records));
911   bluetooth$gatt$cxxbridge1$add_service(server_id, &service_records$.value);
912 }
913 
remove_service(::std::uint8_t server_id,::std::uint16_t service_handle)914 void remove_service(::std::uint8_t server_id, ::std::uint16_t service_handle) noexcept {
915   bluetooth$gatt$cxxbridge1$remove_service(server_id, service_handle);
916 }
917 
send_response(::std::uint8_t server_id,::std::uint16_t conn_id,::std::uint32_t trans_id,::std::uint8_t status,::rust::Slice<::std::uint8_t const> value)918 void send_response(::std::uint8_t server_id, ::std::uint16_t conn_id, ::std::uint32_t trans_id, ::std::uint8_t status, ::rust::Slice<::std::uint8_t const> value) noexcept {
919   bluetooth$gatt$cxxbridge1$send_response(server_id, conn_id, trans_id, status, value);
920 }
921 
send_indication(::std::uint8_t _server_id,::std::uint16_t handle,::std::uint16_t conn_id,::rust::Slice<::std::uint8_t const> value)922 void send_indication(::std::uint8_t _server_id, ::std::uint16_t handle, ::std::uint16_t conn_id, ::rust::Slice<::std::uint8_t const> value) noexcept {
923   bluetooth$gatt$cxxbridge1$send_indication(_server_id, handle, conn_id, value);
924 }
925 
is_connection_isolated(::std::uint16_t conn_id)926 bool is_connection_isolated(::std::uint16_t conn_id) noexcept {
927   return bluetooth$gatt$cxxbridge1$is_connection_isolated(conn_id);
928 }
929 
associate_server_with_advertiser(::std::uint8_t server_id,::std::uint8_t advertiser_id)930 void associate_server_with_advertiser(::std::uint8_t server_id, ::std::uint8_t advertiser_id) noexcept {
931   bluetooth$gatt$cxxbridge1$associate_server_with_advertiser(server_id, advertiser_id);
932 }
933 
clear_advertiser(::std::uint8_t advertiser_id)934 void clear_advertiser(::std::uint8_t advertiser_id) noexcept {
935   bluetooth$gatt$cxxbridge1$clear_advertiser(advertiser_id);
936 }
937 } // namespace gatt
938 } // namespace bluetooth
939 
940 extern "C" {
941 static_assert(::rust::detail::is_complete<::bluetooth::gatt::GattServerCallbacks>::value, "definition of GattServerCallbacks is required");
942 static_assert(sizeof(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks>) == sizeof(void *), "");
943 static_assert(alignof(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks>) == alignof(void *), "");
cxxbridge1$unique_ptr$bluetooth$gatt$GattServerCallbacks$null(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks> * ptr)944 void cxxbridge1$unique_ptr$bluetooth$gatt$GattServerCallbacks$null(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks> *ptr) noexcept {
945   ::new (ptr) ::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks>();
946 }
cxxbridge1$unique_ptr$bluetooth$gatt$GattServerCallbacks$raw(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks> * ptr,::bluetooth::gatt::GattServerCallbacks * raw)947 void cxxbridge1$unique_ptr$bluetooth$gatt$GattServerCallbacks$raw(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks> *ptr, ::bluetooth::gatt::GattServerCallbacks *raw) noexcept {
948   ::new (ptr) ::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks>(raw);
949 }
cxxbridge1$unique_ptr$bluetooth$gatt$GattServerCallbacks$get(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks> const & ptr)950 ::bluetooth::gatt::GattServerCallbacks const *cxxbridge1$unique_ptr$bluetooth$gatt$GattServerCallbacks$get(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks> const &ptr) noexcept {
951   return ptr.get();
952 }
cxxbridge1$unique_ptr$bluetooth$gatt$GattServerCallbacks$release(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks> & ptr)953 ::bluetooth::gatt::GattServerCallbacks *cxxbridge1$unique_ptr$bluetooth$gatt$GattServerCallbacks$release(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks> &ptr) noexcept {
954   return ptr.release();
955 }
cxxbridge1$unique_ptr$bluetooth$gatt$GattServerCallbacks$drop(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks> * ptr)956 void cxxbridge1$unique_ptr$bluetooth$gatt$GattServerCallbacks$drop(::std::unique_ptr<::bluetooth::gatt::GattServerCallbacks> *ptr) noexcept {
957   ::rust::deleter_if<::rust::detail::is_complete<::bluetooth::gatt::GattServerCallbacks>::value>{}(ptr);
958 }
959 
960 void cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$new(::rust::Vec<::bluetooth::gatt::GattRecord> const *ptr) noexcept;
961 void cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$drop(::rust::Vec<::bluetooth::gatt::GattRecord> *ptr) noexcept;
962 ::std::size_t cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$len(::rust::Vec<::bluetooth::gatt::GattRecord> const *ptr) noexcept;
963 ::std::size_t cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$capacity(::rust::Vec<::bluetooth::gatt::GattRecord> const *ptr) noexcept;
964 ::bluetooth::gatt::GattRecord const *cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$data(::rust::Vec<::bluetooth::gatt::GattRecord> const *ptr) noexcept;
965 void cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$reserve_total(::rust::Vec<::bluetooth::gatt::GattRecord> *ptr, ::std::size_t new_cap) noexcept;
966 void cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$set_len(::rust::Vec<::bluetooth::gatt::GattRecord> *ptr, ::std::size_t len) noexcept;
967 void cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$truncate(::rust::Vec<::bluetooth::gatt::GattRecord> *ptr, ::std::size_t len) noexcept;
968 } // extern "C"
969 
970 namespace rust {
971 inline namespace cxxbridge1 {
972 template <>
Vec()973 Vec<::bluetooth::gatt::GattRecord>::Vec() noexcept {
974   cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$new(this);
975 }
976 template <>
drop()977 void Vec<::bluetooth::gatt::GattRecord>::drop() noexcept {
978   return cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$drop(this);
979 }
980 template <>
size() const981 ::std::size_t Vec<::bluetooth::gatt::GattRecord>::size() const noexcept {
982   return cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$len(this);
983 }
984 template <>
capacity() const985 ::std::size_t Vec<::bluetooth::gatt::GattRecord>::capacity() const noexcept {
986   return cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$capacity(this);
987 }
988 template <>
data() const989 ::bluetooth::gatt::GattRecord const *Vec<::bluetooth::gatt::GattRecord>::data() const noexcept {
990   return cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$data(this);
991 }
992 template <>
reserve_total(::std::size_t new_cap)993 void Vec<::bluetooth::gatt::GattRecord>::reserve_total(::std::size_t new_cap) noexcept {
994   return cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$reserve_total(this, new_cap);
995 }
996 template <>
set_len(::std::size_t len)997 void Vec<::bluetooth::gatt::GattRecord>::set_len(::std::size_t len) noexcept {
998   return cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$set_len(this, len);
999 }
1000 template <>
truncate(::std::size_t len)1001 void Vec<::bluetooth::gatt::GattRecord>::truncate(::std::size_t len) {
1002   return cxxbridge1$rust_vec$bluetooth$gatt$GattRecord$truncate(this, len);
1003 }
1004 } // namespace cxxbridge1
1005 } // namespace rust
1006