#pragma once
#include <algorithm>
#include <array>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <exception>
#include <initializer_list>
#include <iosfwd>
#include <iterator>
#include <new>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#if defined(_WIN32)
#include <basetsd.h>
#else
#include <sys/types.h>
#endif
namespace rust {
inline namespace cxxbridge1 {
struct unsafe_bitcopy_t;
namespace {
template <typename T>
class impl;
}
#ifndef CXXBRIDGE1_RUST_STRING
#define CXXBRIDGE1_RUST_STRING
class String final { … };
#endif
#ifndef CXXBRIDGE1_RUST_STR
#define CXXBRIDGE1_RUST_STR
class Str final { … };
#endif
#ifndef CXXBRIDGE1_RUST_SLICE
namespace detail {
template <bool>
struct copy_assignable_if { … };
template <>
struct copy_assignable_if<false> { … };
}
template <typename T>
class Slice final
: private detail::copy_assignable_if<std::is_const<T>::value> { … };
template <typename T>
class Slice<T>::iterator final { … };
#endif
#ifndef CXXBRIDGE1_RUST_BOX
template <typename T>
class Box final { … };
#endif
#ifndef CXXBRIDGE1_RUST_VEC
template <typename T>
class Vec final { … };
#endif
#ifndef CXXBRIDGE1_RUST_FN
template <typename Signature>
class Fn;
Fn<Ret (Args...)>;
#endif
#ifndef CXXBRIDGE1_RUST_ERROR
#define CXXBRIDGE1_RUST_ERROR
class Error final : public std::exception { … };
#endif
#ifndef CXXBRIDGE1_RUST_ISIZE
#define CXXBRIDGE1_RUST_ISIZE
#if defined(_WIN32)
using isize = SSIZE_T;
#else
isize;
#endif
#endif
std::ostream &operator<<(std::ostream &, const String &);
std::ostream &operator<<(std::ostream &, const Str &);
#ifndef CXXBRIDGE1_RUST_OPAQUE
#define CXXBRIDGE1_RUST_OPAQUE
class Opaque { … };
#endif
template <typename T>
std::size_t size_of();
template <typename T>
std::size_t align_of();
template <typename T>
struct IsRelocatable;
u8;
u16;
u32;
u64;
usize;
i8;
i16;
i32;
i64;
f32;
f64;
string;
str;
slice;
box;
vec;
error;
fn;
is_relocatable;
#ifndef CXXBRIDGE1_PANIC
#define CXXBRIDGE1_PANIC
template <typename Exception>
void panic [[noreturn]] (const char *msg);
#endif
#ifndef CXXBRIDGE1_RUST_FN
#define CXXBRIDGE1_RUST_FN
template <typename Ret, typename... Args>
Ret Fn<Ret(Args...)>::operator()(Args... args) const noexcept { … }
template <typename Ret, typename... Args>
Fn<Ret(Args...)> Fn<Ret(Args...)>::operator*() const noexcept { … }
#endif
#ifndef CXXBRIDGE1_RUST_BITCOPY_T
#define CXXBRIDGE1_RUST_BITCOPY_T
struct unsafe_bitcopy_t final { … };
#endif
#ifndef CXXBRIDGE1_RUST_BITCOPY
#define CXXBRIDGE1_RUST_BITCOPY
constexpr unsafe_bitcopy_t unsafe_bitcopy{ … };
#endif
#ifndef CXXBRIDGE1_RUST_SLICE
#define CXXBRIDGE1_RUST_SLICE
template <typename T>
Slice<T>::Slice() noexcept { … }
template <typename T>
Slice<T>::Slice(T *s, std::size_t count) noexcept { … }
template <typename T>
T *Slice<T>::data() const noexcept { … }
template <typename T>
std::size_t Slice<T>::size() const noexcept { … }
template <typename T>
std::size_t Slice<T>::length() const noexcept { … }
template <typename T>
bool Slice<T>::empty() const noexcept { … }
template <typename T>
T &Slice<T>::operator[](std::size_t n) const noexcept { … }
template <typename T>
T &Slice<T>::at(std::size_t n) const { … }
template <typename T>
T &Slice<T>::front() const noexcept { … }
template <typename T>
T &Slice<T>::back() const noexcept { … }
template <typename T>
typename Slice<T>::iterator::reference
Slice<T>::iterator::operator*() const noexcept { … }
template <typename T>
typename Slice<T>::iterator::pointer
Slice<T>::iterator::operator->() const noexcept { … }
template <typename T>
typename Slice<T>::iterator::reference Slice<T>::iterator::operator[](
typename Slice<T>::iterator::difference_type n) const noexcept { … }
template <typename T>
typename Slice<T>::iterator &Slice<T>::iterator::operator++() noexcept { … }
template <typename T>
typename Slice<T>::iterator Slice<T>::iterator::operator++(int) noexcept { … }
template <typename T>
typename Slice<T>::iterator &Slice<T>::iterator::operator--() noexcept { … }
template <typename T>
typename Slice<T>::iterator Slice<T>::iterator::operator--(int) noexcept { … }
template <typename T>
typename Slice<T>::iterator &Slice<T>::iterator::operator+=(
typename Slice<T>::iterator::difference_type n) noexcept { … }
template <typename T>
typename Slice<T>::iterator &Slice<T>::iterator::operator-=(
typename Slice<T>::iterator::difference_type n) noexcept { … }
template <typename T>
typename Slice<T>::iterator Slice<T>::iterator::operator+(
typename Slice<T>::iterator::difference_type n) const noexcept { … }
template <typename T>
typename Slice<T>::iterator Slice<T>::iterator::operator-(
typename Slice<T>::iterator::difference_type n) const noexcept { … }
template <typename T>
typename Slice<T>::iterator::difference_type
Slice<T>::iterator::operator-(const iterator &other) const noexcept { … }
template <typename T>
bool Slice<T>::iterator::operator==(const iterator &other) const noexcept { … }
template <typename T>
bool Slice<T>::iterator::operator!=(const iterator &other) const noexcept { … }
template <typename T>
bool Slice<T>::iterator::operator<(const iterator &other) const noexcept { … }
template <typename T>
bool Slice<T>::iterator::operator<=(const iterator &other) const noexcept { … }
template <typename T>
bool Slice<T>::iterator::operator>(const iterator &other) const noexcept { … }
template <typename T>
bool Slice<T>::iterator::operator>=(const iterator &other) const noexcept { … }
template <typename T>
typename Slice<T>::iterator Slice<T>::begin() const noexcept { … }
template <typename T>
typename Slice<T>::iterator Slice<T>::end() const noexcept { … }
template <typename T>
void Slice<T>::swap(Slice &rhs) noexcept { … }
#endif
#ifndef CXXBRIDGE1_RUST_BOX
#define CXXBRIDGE1_RUST_BOX
template <typename T>
class Box<T>::uninit { … };
template <typename T>
class Box<T>::allocation { … };
template <typename T>
Box<T>::Box(Box &&other) noexcept : … { … }
template <typename T>
Box<T>::Box(const T &val) { … }
template <typename T>
Box<T>::Box(T &&val) { … }
template <typename T>
Box<T>::~Box() noexcept { … }
template <typename T>
Box<T> &Box<T>::operator=(Box &&other) &noexcept { … }
template <typename T>
const T *Box<T>::operator->() const noexcept { … }
template <typename T>
const T &Box<T>::operator*() const noexcept { … }
template <typename T>
T *Box<T>::operator->() noexcept { … }
template <typename T>
T &Box<T>::operator*() noexcept { … }
template <typename T>
template <typename... Fields>
Box<T> Box<T>::in_place(Fields &&...fields) { … }
template <typename T>
void Box<T>::swap(Box &rhs) noexcept { … }
template <typename T>
Box<T> Box<T>::from_raw(T *raw) noexcept { … }
template <typename T>
T *Box<T>::into_raw() noexcept { … }
template <typename T>
Box<T>::Box(uninit) noexcept { … }
#endif
#ifndef CXXBRIDGE1_RUST_VEC
#define CXXBRIDGE1_RUST_VEC
template <typename T>
Vec<T>::Vec(std::initializer_list<T> init) : … { … }
template <typename T>
Vec<T>::Vec(const Vec &other) : … { … }
template <typename T>
Vec<T>::Vec(Vec &&other) noexcept : … { … }
template <typename T>
Vec<T>::~Vec() noexcept { … }
template <typename T>
Vec<T> &Vec<T>::operator=(Vec &&other) &noexcept { … }
template <typename T>
Vec<T> &Vec<T>::operator=(const Vec &other) & { … }
template <typename T>
bool Vec<T>::empty() const noexcept { … }
template <typename T>
T *Vec<T>::data() noexcept { … }
template <typename T>
const T &Vec<T>::operator[](std::size_t n) const noexcept { … }
template <typename T>
const T &Vec<T>::at(std::size_t n) const { … }
template <typename T>
const T &Vec<T>::front() const noexcept { … }
template <typename T>
const T &Vec<T>::back() const noexcept { … }
template <typename T>
T &Vec<T>::operator[](std::size_t n) noexcept { … }
template <typename T>
T &Vec<T>::at(std::size_t n) { … }
template <typename T>
T &Vec<T>::front() noexcept { … }
template <typename T>
T &Vec<T>::back() noexcept { … }
template <typename T>
void Vec<T>::reserve(std::size_t new_cap) { … }
template <typename T>
void Vec<T>::push_back(const T &value) { … }
template <typename T>
void Vec<T>::push_back(T &&value) { … }
template <typename T>
template <typename... Args>
void Vec<T>::emplace_back(Args &&...args) { … }
template <typename T>
void Vec<T>::clear() { … }
template <typename T>
typename Vec<T>::iterator Vec<T>::begin() noexcept { … }
template <typename T>
typename Vec<T>::iterator Vec<T>::end() noexcept { … }
template <typename T>
typename Vec<T>::const_iterator Vec<T>::begin() const noexcept { … }
template <typename T>
typename Vec<T>::const_iterator Vec<T>::end() const noexcept { … }
template <typename T>
typename Vec<T>::const_iterator Vec<T>::cbegin() const noexcept { … }
template <typename T>
typename Vec<T>::const_iterator Vec<T>::cend() const noexcept { … }
template <typename T>
void Vec<T>::swap(Vec &rhs) noexcept { … }
template <typename T>
Vec<T>::Vec(unsafe_bitcopy_t, const Vec &bits) noexcept : … { … }
#endif
#ifndef CXXBRIDGE1_IS_COMPLETE
#define CXXBRIDGE1_IS_COMPLETE
namespace detail {
namespace {
template <typename T, typename = std::size_t>
struct is_complete : std::false_type { … };
is_complete<T, decltype(sizeof(T))>;
}
}
#endif
#ifndef CXXBRIDGE1_LAYOUT
#define CXXBRIDGE1_LAYOUT
class layout { … };
template <typename T>
std::size_t size_of() { … }
template <typename T>
std::size_t align_of() { … }
#endif
#ifndef CXXBRIDGE1_RELOCATABLE
#define CXXBRIDGE1_RELOCATABLE
namespace detail {
template <typename... Ts>
struct make_void { … };
void_t;
template <typename Void, template <typename...> class, typename...>
struct detect : std::false_type { … };
detect<void_t<T<A...>>, T, A...>;
is_detected;
detect_IsRelocatable;
template <typename T>
struct get_IsRelocatable
: std::is_same<typename T::IsRelocatable, std::true_type> { … };
}
template <typename T>
struct IsRelocatable
: std::conditional<
detail::is_detected<detail::detect_IsRelocatable, T>::value,
detail::get_IsRelocatable<T>,
std::integral_constant<
bool, std::is_trivially_move_constructible<T>::value &&
std::is_trivially_destructible<T>::value>>::type { … };
#endif
}
}