| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 1 | #pragma once |
| 2 | #include <array> |
| David Tolnay | 30430f1 | 2020-03-19 20:49:00 -0700 | [diff] [blame] | 3 | #include <cstddef> |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 4 | #include <cstdint> |
| David Tolnay | b7a7cb6 | 2020-03-17 21:18:40 -0700 | [diff] [blame] | 5 | #include <exception> |
| David Tolnay | 001102a | 2020-03-01 20:05:04 -0800 | [diff] [blame] | 6 | #include <iosfwd> |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 7 | #include <string> |
| David Tolnay | f629237 | 2020-03-01 21:09:11 -0800 | [diff] [blame] | 8 | #include <type_traits> |
| David Tolnay | 4791f1c | 2020-03-17 21:53:16 -0700 | [diff] [blame] | 9 | #include <utility> |
| David Tolnay | 37dd7e1 | 2020-04-25 12:51:59 -0700 | [diff] [blame] | 10 | #include <vector> |
| David Tolnay | 59b5ba1 | 2020-04-10 11:32:19 -0700 | [diff] [blame] | 11 | #if defined(_WIN32) |
| 12 | #include <BaseTsd.h> |
| 13 | #endif |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 14 | |
| David Tolnay | 750755e | 2020-03-01 13:04:08 -0800 | [diff] [blame] | 15 | namespace rust { |
| David Tolnay | 8c73049 | 2020-03-13 01:29:06 -0700 | [diff] [blame] | 16 | inline namespace cxxbridge02 { |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 17 | |
| David Tolnay | d1e2efc | 2020-03-03 22:25:43 -0800 | [diff] [blame] | 18 | struct unsafe_bitcopy_t; |
| 19 | |
| David Tolnay | b7a7cb6 | 2020-03-17 21:18:40 -0700 | [diff] [blame] | 20 | #ifndef CXXBRIDGE02_RUST_STRING |
| 21 | #define CXXBRIDGE02_RUST_STRING |
| David Tolnay | 5608216 | 2020-03-01 12:57:33 -0800 | [diff] [blame] | 22 | class String final { |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 23 | public: |
| David Tolnay | 5608216 | 2020-03-01 12:57:33 -0800 | [diff] [blame] | 24 | String() noexcept; |
| David Tolnay | d9c4ac9 | 2020-03-01 20:33:58 -0800 | [diff] [blame] | 25 | String(const String &) noexcept; |
| 26 | String(String &&) noexcept; |
| David Tolnay | 5608216 | 2020-03-01 12:57:33 -0800 | [diff] [blame] | 27 | ~String() noexcept; |
| David Tolnay | d9c4ac9 | 2020-03-01 20:33:58 -0800 | [diff] [blame] | 28 | |
| 29 | String(const std::string &); |
| 30 | String(const char *); |
| 31 | |
| 32 | String &operator=(const String &) noexcept; |
| 33 | String &operator=(String &&) noexcept; |
| 34 | |
| David Tolnay | 404d689 | 2020-03-01 20:19:41 -0800 | [diff] [blame] | 35 | explicit operator std::string() const; |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 36 | |
| 37 | // Note: no null terminator. |
| 38 | const char *data() const noexcept; |
| 39 | size_t size() const noexcept; |
| 40 | size_t length() const noexcept; |
| 41 | |
| David Tolnay | d1e2efc | 2020-03-03 22:25:43 -0800 | [diff] [blame] | 42 | // Internal API only intended for the cxxbridge code generator. |
| 43 | String(unsafe_bitcopy_t, const String &) noexcept; |
| 44 | |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 45 | private: |
| 46 | // Size and alignment statically verified by rust_string.rs. |
| 47 | std::array<uintptr_t, 3> repr; |
| 48 | }; |
| David Tolnay | b7a7cb6 | 2020-03-17 21:18:40 -0700 | [diff] [blame] | 49 | #endif // CXXBRIDGE02_RUST_STRING |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 50 | |
| David Tolnay | b7a7cb6 | 2020-03-17 21:18:40 -0700 | [diff] [blame] | 51 | #ifndef CXXBRIDGE02_RUST_STR |
| 52 | #define CXXBRIDGE02_RUST_STR |
| David Tolnay | 09dbe75 | 2020-03-01 13:00:40 -0800 | [diff] [blame] | 53 | class Str final { |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 54 | public: |
| David Tolnay | 09dbe75 | 2020-03-01 13:00:40 -0800 | [diff] [blame] | 55 | Str() noexcept; |
| David Tolnay | d9c4ac9 | 2020-03-01 20:33:58 -0800 | [diff] [blame] | 56 | Str(const Str &) noexcept; |
| 57 | |
| David Tolnay | 851677c | 2020-03-01 23:49:46 -0800 | [diff] [blame] | 58 | Str(const std::string &); |
| 59 | Str(const char *); |
| 60 | Str(std::string &&) = delete; |
| David Tolnay | d9c4ac9 | 2020-03-01 20:33:58 -0800 | [diff] [blame] | 61 | |
| 62 | Str &operator=(Str) noexcept; |
| 63 | |
| David Tolnay | 404d689 | 2020-03-01 20:19:41 -0800 | [diff] [blame] | 64 | explicit operator std::string() const; |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 65 | |
| 66 | // Note: no null terminator. |
| 67 | const char *data() const noexcept; |
| 68 | size_t size() const noexcept; |
| 69 | size_t length() const noexcept; |
| 70 | |
| 71 | // Repr is PRIVATE; must not be used other than by our generated code. |
| 72 | // |
| 73 | // Not necessarily ABI compatible with &str. Codegen will translate to |
| 74 | // cxx::rust_str::RustStr which matches this layout. |
| 75 | struct Repr { |
| 76 | const char *ptr; |
| 77 | size_t len; |
| 78 | }; |
| David Tolnay | d9c4ac9 | 2020-03-01 20:33:58 -0800 | [diff] [blame] | 79 | Str(Repr) noexcept; |
| David Tolnay | baae443 | 2020-03-01 20:20:10 -0800 | [diff] [blame] | 80 | explicit operator Repr() noexcept; |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 81 | |
| 82 | private: |
| 83 | Repr repr; |
| 84 | }; |
| David Tolnay | b7a7cb6 | 2020-03-17 21:18:40 -0700 | [diff] [blame] | 85 | #endif // CXXBRIDGE02_RUST_STR |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 86 | |
| David Tolnay | efe8105 | 2020-04-14 16:28:24 -0700 | [diff] [blame] | 87 | #ifndef CXXBRIDGE02_RUST_SLICE |
| 88 | #define CXXBRIDGE02_RUST_SLICE |
| 89 | template <typename T> |
| 90 | class Slice final { |
| 91 | public: |
| 92 | Slice() noexcept : repr(Repr{reinterpret_cast<const T *>(this), 0}) {} |
| 93 | Slice(const Slice<T> &) noexcept = default; |
| 94 | |
| 95 | Slice(const T *s, size_t size) : repr(Repr{s, size}) {} |
| 96 | |
| 97 | Slice &operator=(Slice<T> other) noexcept { |
| 98 | this->repr = other.repr; |
| 99 | return *this; |
| 100 | } |
| 101 | |
| 102 | const T *data() const noexcept { return this->repr.ptr; } |
| 103 | size_t size() const noexcept { return this->repr.len; } |
| 104 | size_t length() const noexcept { return this->repr.len; } |
| 105 | |
| 106 | // Repr is PRIVATE; must not be used other than by our generated code. |
| 107 | // |
| 108 | // At present this class is only used for &[u8] slices. |
| 109 | // Not necessarily ABI compatible with &[u8]. Codegen will translate to |
| David Tolnay | e710af1 | 2020-04-14 16:31:54 -0700 | [diff] [blame] | 110 | // cxx::rust_sliceu8::RustSliceU8 which matches this layout. |
| David Tolnay | efe8105 | 2020-04-14 16:28:24 -0700 | [diff] [blame] | 111 | struct Repr { |
| 112 | const T *ptr; |
| 113 | size_t len; |
| 114 | }; |
| 115 | Slice(Repr repr_) noexcept : repr(repr_) {} |
| 116 | explicit operator Repr() noexcept { return this->repr; } |
| 117 | |
| 118 | private: |
| 119 | Repr repr; |
| 120 | }; |
| 121 | #endif // CXXBRIDGE02_RUST_SLICE |
| 122 | |
| David Tolnay | 8c73049 | 2020-03-13 01:29:06 -0700 | [diff] [blame] | 123 | #ifndef CXXBRIDGE02_RUST_BOX |
| 124 | #define CXXBRIDGE02_RUST_BOX |
| David Tolnay | f262d38 | 2020-04-11 22:12:40 -0700 | [diff] [blame] | 125 | template <typename T> |
| 126 | class Box final { |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 127 | public: |
| David Tolnay | f629237 | 2020-03-01 21:09:11 -0800 | [diff] [blame] | 128 | using value_type = T; |
| David Tolnay | 9706a51 | 2020-04-24 17:09:01 -0700 | [diff] [blame] | 129 | using const_pointer = |
| 130 | typename std::add_pointer<typename std::add_const<T>::type>::type; |
| 131 | using pointer = typename std::add_pointer<T>::type; |
| David Tolnay | f629237 | 2020-03-01 21:09:11 -0800 | [diff] [blame] | 132 | |
| David Tolnay | 324437a | 2020-03-01 13:02:24 -0800 | [diff] [blame] | 133 | Box(const Box &other) : Box(*other) {} |
| David Tolnay | 33169bd | 2020-03-06 13:02:08 -0800 | [diff] [blame] | 134 | Box(Box &&other) noexcept : ptr(other.ptr) { other.ptr = nullptr; } |
| David Tolnay | 7db7dad | 2020-04-11 14:12:49 -0700 | [diff] [blame] | 135 | explicit Box(const T &val) { |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 136 | this->uninit(); |
| David Tolnay | 33169bd | 2020-03-06 13:02:08 -0800 | [diff] [blame] | 137 | ::new (this->ptr) T(val); |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 138 | } |
| David Tolnay | 7db7dad | 2020-04-11 14:12:49 -0700 | [diff] [blame] | 139 | explicit Box(T &&val) { |
| David Tolnay | 47b3cf2 | 2020-04-11 00:54:39 -0700 | [diff] [blame] | 140 | this->uninit(); |
| 141 | ::new (this->ptr) T(std::move(val)); |
| 142 | } |
| David Tolnay | 324437a | 2020-03-01 13:02:24 -0800 | [diff] [blame] | 143 | Box &operator=(const Box &other) { |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 144 | if (this != &other) { |
| David Tolnay | 33169bd | 2020-03-06 13:02:08 -0800 | [diff] [blame] | 145 | if (this->ptr) { |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 146 | **this = *other; |
| 147 | } else { |
| 148 | this->uninit(); |
| David Tolnay | 33169bd | 2020-03-06 13:02:08 -0800 | [diff] [blame] | 149 | ::new (this->ptr) T(*other); |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 150 | } |
| 151 | } |
| 152 | return *this; |
| 153 | } |
| David Tolnay | 324437a | 2020-03-01 13:02:24 -0800 | [diff] [blame] | 154 | Box &operator=(Box &&other) noexcept { |
| David Tolnay | 33169bd | 2020-03-06 13:02:08 -0800 | [diff] [blame] | 155 | if (this->ptr) { |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 156 | this->drop(); |
| 157 | } |
| David Tolnay | 33169bd | 2020-03-06 13:02:08 -0800 | [diff] [blame] | 158 | this->ptr = other.ptr; |
| 159 | other.ptr = nullptr; |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 160 | return *this; |
| 161 | } |
| David Tolnay | 324437a | 2020-03-01 13:02:24 -0800 | [diff] [blame] | 162 | ~Box() noexcept { |
| David Tolnay | 33169bd | 2020-03-06 13:02:08 -0800 | [diff] [blame] | 163 | if (this->ptr) { |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 164 | this->drop(); |
| 165 | } |
| 166 | } |
| 167 | |
| David Tolnay | 33169bd | 2020-03-06 13:02:08 -0800 | [diff] [blame] | 168 | const T *operator->() const noexcept { return this->ptr; } |
| 169 | const T &operator*() const noexcept { return *this->ptr; } |
| 170 | T *operator->() noexcept { return this->ptr; } |
| 171 | T &operator*() noexcept { return *this->ptr; } |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 172 | |
| David Tolnay | f262d38 | 2020-04-11 22:12:40 -0700 | [diff] [blame] | 173 | template <typename... Fields> |
| 174 | static Box in_place(Fields &&... fields) { |
| David Tolnay | 7ce59fc | 2020-04-11 11:46:33 -0700 | [diff] [blame] | 175 | Box box; |
| 176 | box.uninit(); |
| 177 | ::new (box.ptr) T{std::forward<Fields>(fields)...}; |
| 178 | return box; |
| 179 | } |
| 180 | |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 181 | // Important: requires that `raw` came from an into_raw call. Do not pass a |
| 182 | // pointer from `new` or any other source. |
| David Tolnay | 324437a | 2020-03-01 13:02:24 -0800 | [diff] [blame] | 183 | static Box from_raw(T *raw) noexcept { |
| 184 | Box box; |
| David Tolnay | 33169bd | 2020-03-06 13:02:08 -0800 | [diff] [blame] | 185 | box.ptr = raw; |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 186 | return box; |
| 187 | } |
| 188 | |
| 189 | T *into_raw() noexcept { |
| David Tolnay | 33169bd | 2020-03-06 13:02:08 -0800 | [diff] [blame] | 190 | T *raw = this->ptr; |
| 191 | this->ptr = nullptr; |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 192 | return raw; |
| 193 | } |
| 194 | |
| 195 | private: |
| David Tolnay | 324437a | 2020-03-01 13:02:24 -0800 | [diff] [blame] | 196 | Box() noexcept {} |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 197 | void uninit() noexcept; |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 198 | void drop() noexcept; |
| David Tolnay | 33169bd | 2020-03-06 13:02:08 -0800 | [diff] [blame] | 199 | T *ptr; |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 200 | }; |
| David Tolnay | 8c73049 | 2020-03-13 01:29:06 -0700 | [diff] [blame] | 201 | #endif // CXXBRIDGE02_RUST_BOX |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 202 | |
| David Tolnay | 7f2dc3b | 2020-04-24 16:46:39 -0700 | [diff] [blame^] | 203 | #ifndef CXXBRIDGE02_RUST_VEC |
| 204 | #define CXXBRIDGE02_RUST_VEC |
| 205 | template <typename T> |
| 206 | class Vec final { |
| 207 | public: |
| 208 | size_t size() const noexcept; |
| 209 | |
| 210 | private: |
| 211 | Vec() noexcept; |
| 212 | Vec(const Vec &other) noexcept; |
| 213 | Vec &operator=(Vec other) noexcept; |
| 214 | void drop() noexcept; |
| 215 | |
| 216 | // Size and alignment statically verified by rust_vec.rs. |
| 217 | std::array<uintptr_t, 3> repr; |
| 218 | }; |
| 219 | #endif // CXXBRIDGE02_RUST_VEC |
| 220 | |
| David Tolnay | 75dca2e | 2020-03-25 20:17:52 -0700 | [diff] [blame] | 221 | #ifndef CXXBRIDGE02_RUST_FN |
| 222 | #define CXXBRIDGE02_RUST_FN |
| David Tolnay | f262d38 | 2020-04-11 22:12:40 -0700 | [diff] [blame] | 223 | template <typename Signature, bool Throws = false> |
| 224 | class Fn; |
| David Tolnay | 75dca2e | 2020-03-25 20:17:52 -0700 | [diff] [blame] | 225 | |
| 226 | template <typename Ret, typename... Args, bool Throws> |
| 227 | class Fn<Ret(Args...), Throws> { |
| 228 | public: |
| David Tolnay | 533d458 | 2020-04-08 20:29:14 -0700 | [diff] [blame] | 229 | Ret operator()(Args... args) const noexcept(!Throws); |
| 230 | Fn operator*() const noexcept; |
| David Tolnay | 75dca2e | 2020-03-25 20:17:52 -0700 | [diff] [blame] | 231 | |
| 232 | private: |
| 233 | Ret (*trampoline)(Args..., void *fn) noexcept(!Throws); |
| 234 | void *fn; |
| 235 | }; |
| 236 | |
| David Tolnay | f262d38 | 2020-04-11 22:12:40 -0700 | [diff] [blame] | 237 | template <typename Signature> |
| 238 | using TryFn = Fn<Signature, true>; |
| David Tolnay | 75dca2e | 2020-03-25 20:17:52 -0700 | [diff] [blame] | 239 | #endif // CXXBRIDGE02_RUST_FN |
| 240 | |
| David Tolnay | b7a7cb6 | 2020-03-17 21:18:40 -0700 | [diff] [blame] | 241 | #ifndef CXXBRIDGE02_RUST_ERROR |
| 242 | #define CXXBRIDGE02_RUST_ERROR |
| David Tolnay | 1e54817 | 2020-03-16 13:37:09 -0700 | [diff] [blame] | 243 | class Error final : std::exception { |
| 244 | public: |
| 245 | Error(const Error &); |
| 246 | Error(Error &&) noexcept; |
| 247 | Error(Str::Repr) noexcept; |
| 248 | ~Error() noexcept; |
| 249 | const char *what() const noexcept override; |
| 250 | |
| 251 | private: |
| 252 | Str::Repr msg; |
| 253 | }; |
| David Tolnay | b7a7cb6 | 2020-03-17 21:18:40 -0700 | [diff] [blame] | 254 | #endif // CXXBRIDGE02_RUST_ERROR |
| David Tolnay | 1e54817 | 2020-03-16 13:37:09 -0700 | [diff] [blame] | 255 | |
| David Tolnay | b8a6fb2 | 2020-04-10 11:17:28 -0700 | [diff] [blame] | 256 | #ifndef CXXBRIDGE02_RUST_ISIZE |
| 257 | #define CXXBRIDGE02_RUST_ISIZE |
| 258 | #if defined(_WIN32) |
| 259 | using isize = SSIZE_T; |
| 260 | #else |
| 261 | using isize = ssize_t; |
| 262 | #endif |
| 263 | #endif // CXXBRIDGE02_RUST_ISIZE |
| 264 | |
| David Tolnay | 851677c | 2020-03-01 23:49:46 -0800 | [diff] [blame] | 265 | std::ostream &operator<<(std::ostream &, const String &); |
| 266 | std::ostream &operator<<(std::ostream &, const Str &); |
| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 267 | |
| David Tolnay | 3b0c988 | 2020-03-01 14:08:57 -0800 | [diff] [blame] | 268 | // Snake case aliases for use in code that uses this style for type names. |
| 269 | using string = String; |
| 270 | using str = Str; |
| David Tolnay | f262d38 | 2020-04-11 22:12:40 -0700 | [diff] [blame] | 271 | template <class T> |
| 272 | using box = Box<T>; |
| David Tolnay | 1e54817 | 2020-03-16 13:37:09 -0700 | [diff] [blame] | 273 | using error = Error; |
| David Tolnay | 75dca2e | 2020-03-25 20:17:52 -0700 | [diff] [blame] | 274 | template <typename Signature, bool Throws = false> |
| 275 | using fn = Fn<Signature, Throws>; |
| David Tolnay | f262d38 | 2020-04-11 22:12:40 -0700 | [diff] [blame] | 276 | template <typename Signature> |
| 277 | using try_fn = TryFn<Signature>; |
| David Tolnay | 3b0c988 | 2020-03-01 14:08:57 -0800 | [diff] [blame] | 278 | |
| David Tolnay | b7a7cb6 | 2020-03-17 21:18:40 -0700 | [diff] [blame] | 279 | #ifndef CXXBRIDGE02_RUST_BITCOPY |
| 280 | #define CXXBRIDGE02_RUST_BITCOPY |
| David Tolnay | d1e2efc | 2020-03-03 22:25:43 -0800 | [diff] [blame] | 281 | struct unsafe_bitcopy_t { |
| 282 | explicit unsafe_bitcopy_t() = default; |
| 283 | }; |
| 284 | constexpr unsafe_bitcopy_t unsafe_bitcopy{}; |
| David Tolnay | b7a7cb6 | 2020-03-17 21:18:40 -0700 | [diff] [blame] | 285 | #endif // CXXBRIDGE02_RUST_BITCOPY |
| David Tolnay | d1e2efc | 2020-03-03 22:25:43 -0800 | [diff] [blame] | 286 | |
| David Tolnay | 75dca2e | 2020-03-25 20:17:52 -0700 | [diff] [blame] | 287 | template <typename Ret, typename... Args, bool Throws> |
| David Tolnay | 533d458 | 2020-04-08 20:29:14 -0700 | [diff] [blame] | 288 | Ret Fn<Ret(Args...), Throws>::operator()(Args... args) const noexcept(!Throws) { |
| David Tolnay | 75dca2e | 2020-03-25 20:17:52 -0700 | [diff] [blame] | 289 | return (*this->trampoline)(std::move(args)..., this->fn); |
| 290 | } |
| 291 | |
| David Tolnay | a23129c | 2020-04-08 20:08:21 -0700 | [diff] [blame] | 292 | template <typename Ret, typename... Args, bool Throws> |
| David Tolnay | 533d458 | 2020-04-08 20:29:14 -0700 | [diff] [blame] | 293 | Fn<Ret(Args...), Throws> Fn<Ret(Args...), Throws>::operator*() const noexcept { |
| David Tolnay | a23129c | 2020-04-08 20:08:21 -0700 | [diff] [blame] | 294 | return *this; |
| 295 | } |
| 296 | |
| David Tolnay | 8c73049 | 2020-03-13 01:29:06 -0700 | [diff] [blame] | 297 | } // namespace cxxbridge02 |
| David Tolnay | 750755e | 2020-03-01 13:04:08 -0800 | [diff] [blame] | 298 | } // namespace rust |