#include "cxx-qt-lib/qstring.h"
#include "cxx-qt-lib/qlist.h"
#include "cxx-qt-lib/qbytearray.h"
#include "cxx-qt-lib/qmap.h"
#include "cxx-qt-lib/qvariant.h"
#include <QtCore/QObject>
#include "cxx-qt/connection.h"
#include "idescriptor_rust_codebase/src/afc2_services.cxxqt.h"
#include "cxx-qt/thread.h"
#include <cstddef>
#include <cstdint>
#include <new>
#include <type_traits>
#include <utility>

#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wmissing-declarations"
#pragma GCC diagnostic ignored "-Wshadow"
#ifdef __clang__
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
#pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
#endif // __clang__
#endif // __GNUC__

namespace rust {
inline namespace cxxbridge1 {
// #include "rust/cxx.h"

#ifndef CXXBRIDGE1_RUST_BOX
#define CXXBRIDGE1_RUST_BOX
template <typename T>
class Box final {
public:
  using element_type = T;
  using const_pointer =
      typename std::add_pointer<typename std::add_const<T>::type>::type;
  using pointer = typename std::add_pointer<T>::type;

  Box() = delete;
  Box(Box &&) noexcept;
  ~Box() noexcept;

  explicit Box(const T &);
  explicit Box(T &&);

  Box &operator=(Box &&) & noexcept;

  const T *operator->() const noexcept;
  const T &operator*() const noexcept;
  T *operator->() noexcept;
  T &operator*() noexcept;

  template <typename... Fields>
  static Box in_place(Fields &&...);

  void swap(Box &) noexcept;

  static Box from_raw(T *) noexcept;

  T *into_raw() noexcept;

  /* Deprecated */ using value_type = element_type;

private:
  class uninit;
  class allocation;
  Box(uninit) noexcept;
  void drop() noexcept;

  friend void swap(Box &lhs, Box &rhs) noexcept { lhs.swap(rhs); }

  T *ptr;
};

template <typename T>
class Box<T>::uninit {};

template <typename T>
class Box<T>::allocation {
  static T *alloc() noexcept;
  static void dealloc(T *) noexcept;

public:
  allocation() noexcept : ptr(alloc()) {}
  ~allocation() noexcept {
    if (this->ptr) {
      dealloc(this->ptr);
    }
  }
  T *ptr;
};

template <typename T>
Box<T>::Box(Box &&other) noexcept : ptr(other.ptr) {
  other.ptr = nullptr;
}

template <typename T>
Box<T>::Box(const T &val) {
  allocation alloc;
  ::new (alloc.ptr) T(val);
  this->ptr = alloc.ptr;
  alloc.ptr = nullptr;
}

template <typename T>
Box<T>::Box(T &&val) {
  allocation alloc;
  ::new (alloc.ptr) T(std::move(val));
  this->ptr = alloc.ptr;
  alloc.ptr = nullptr;
}

template <typename T>
Box<T>::~Box() noexcept {
  if (this->ptr) {
    this->drop();
  }
}

template <typename T>
Box<T> &Box<T>::operator=(Box &&other) & noexcept {
  if (this->ptr) {
    this->drop();
  }
  this->ptr = other.ptr;
  other.ptr = nullptr;
  return *this;
}

template <typename T>
const T *Box<T>::operator->() const noexcept {
  return this->ptr;
}

template <typename T>
const T &Box<T>::operator*() const noexcept {
  return *this->ptr;
}

template <typename T>
T *Box<T>::operator->() noexcept {
  return this->ptr;
}

template <typename T>
T &Box<T>::operator*() noexcept {
  return *this->ptr;
}

template <typename T>
template <typename... Fields>
Box<T> Box<T>::in_place(Fields &&...fields) {
  allocation alloc;
  auto ptr = alloc.ptr;
  ::new (ptr) T{std::forward<Fields>(fields)...};
  alloc.ptr = nullptr;
  return from_raw(ptr);
}

template <typename T>
void Box<T>::swap(Box &rhs) noexcept {
  using std::swap;
  swap(this->ptr, rhs.ptr);
}

template <typename T>
Box<T> Box<T>::from_raw(T *raw) noexcept {
  Box box = uninit{};
  box.ptr = raw;
  return box;
}

template <typename T>
T *Box<T>::into_raw() noexcept {
  T *raw = this->ptr;
  this->ptr = nullptr;
  return raw;
}

template <typename T>
Box<T>::Box(uninit) noexcept {}
#endif // CXXBRIDGE1_RUST_BOX

#ifndef CXXBRIDGE1_RUST_FN
#define CXXBRIDGE1_RUST_FN
template <typename Signature>
class Fn;

template <typename Ret, typename... Args>
class Fn<Ret(Args...)> final {
public:
  Ret operator()(Args... args) const noexcept;
  Fn operator*() const noexcept;

private:
  Ret (*trampoline)(Args..., void *fn) noexcept;
  void *fn;
};

template <typename Ret, typename... Args>
Ret Fn<Ret(Args...)>::operator()(Args... args) const noexcept {
  return (*this->trampoline)(std::forward<Args>(args)..., this->fn);
}

template <typename Ret, typename... Args>
Fn<Ret(Args...)> Fn<Ret(Args...)>::operator*() const noexcept {
  return *this;
}
#endif // CXXBRIDGE1_RUST_FN

#ifndef CXXBRIDGE1_RUST_OPAQUE
#define CXXBRIDGE1_RUST_OPAQUE
class Opaque {
public:
  Opaque() = delete;
  Opaque(const Opaque &) = delete;
  ~Opaque() = delete;
};
#endif // CXXBRIDGE1_RUST_OPAQUE

#ifndef CXXBRIDGE1_IS_COMPLETE
#define CXXBRIDGE1_IS_COMPLETE
namespace detail {
namespace {
template <typename T, typename = std::size_t>
struct is_complete : std::false_type {};
template <typename T>
struct is_complete<T, decltype(sizeof(T))> : std::true_type {};
} // namespace
} // namespace detail
#endif // CXXBRIDGE1_IS_COMPLETE

#ifndef CXXBRIDGE1_LAYOUT
#define CXXBRIDGE1_LAYOUT
class layout {
  template <typename T>
  friend std::size_t size_of();
  template <typename T>
  friend std::size_t align_of();
  template <typename T>
  static typename std::enable_if<std::is_base_of<Opaque, T>::value,
                                 std::size_t>::type
  do_size_of() {
    return T::layout::size();
  }
  template <typename T>
  static typename std::enable_if<!std::is_base_of<Opaque, T>::value,
                                 std::size_t>::type
  do_size_of() {
    return sizeof(T);
  }
  template <typename T>
  static
      typename std::enable_if<detail::is_complete<T>::value, std::size_t>::type
      size_of() {
    return do_size_of<T>();
  }
  template <typename T>
  static typename std::enable_if<std::is_base_of<Opaque, T>::value,
                                 std::size_t>::type
  do_align_of() {
    return T::layout::align();
  }
  template <typename T>
  static typename std::enable_if<!std::is_base_of<Opaque, T>::value,
                                 std::size_t>::type
  do_align_of() {
    return alignof(T);
  }
  template <typename T>
  static
      typename std::enable_if<detail::is_complete<T>::value, std::size_t>::type
      align_of() {
    return do_align_of<T>();
  }
};

template <typename T>
std::size_t size_of() {
  return layout::size_of<T>();
}

template <typename T>
std::size_t align_of() {
  return layout::align_of<T>();
}
#endif // CXXBRIDGE1_LAYOUT

#ifndef CXXBRIDGE1_RELOCATABLE
#define CXXBRIDGE1_RELOCATABLE
namespace detail {
template <typename... Ts>
struct make_void {
  using type = void;
};

template <typename... Ts>
using void_t = typename make_void<Ts...>::type;

template <typename Void, template <typename...> class, typename...>
struct detect : std::false_type {};
template <template <typename...> class T, typename... A>
struct detect<void_t<T<A...>>, T, A...> : std::true_type {};

template <template <typename...> class T, typename... A>
using is_detected = detect<void, T, A...>;

template <typename T>
using detect_IsRelocatable = typename T::IsRelocatable;

template <typename T>
struct get_IsRelocatable
    : std::is_same<typename T::IsRelocatable, std::true_type> {};
} // namespace detail

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 // CXXBRIDGE1_RELOCATABLE

namespace detail {
template <typename T, typename = void *>
struct operator_new {
  void *operator()(::std::size_t sz) { return ::operator new(sz); }
};

template <typename T>
struct operator_new<T, decltype(T::operator new(sizeof(T)))> {
  void *operator()(::std::size_t sz) { return T::operator new(sz); }
};
} // namespace detail

template <typename T>
union ManuallyDrop {
  T value;
  ManuallyDrop(T &&value) : value(::std::move(value)) {}
  ~ManuallyDrop() {}
};

template <typename T>
union MaybeUninit {
  T value;
  void *operator new(::std::size_t sz) { return detail::operator_new<T>{}(sz); }
  MaybeUninit() {}
  ~MaybeUninit() {}
};
} // namespace cxxbridge1
} // namespace rust

#if __cplusplus >= 201402L
#define CXX_DEFAULT_VALUE(value) = value
#else
#define CXX_DEFAULT_VALUE(value)
#endif

namespace CXX {
  using Afc2Backend = ::CXX::Afc2Backend;
  struct RAfc2Backend;
  namespace cxx_qt_Afc2Backend {
    struct Afc2BackendCxxQtThreadQueuedFn;
    struct CxxQtConstructorArguments0;
    struct CxxQtConstructorBaseArguments0;
    struct CxxQtConstructorNewArguments0;
    struct CxxQtConstructorInitializeArguments0;
  }
}

namespace CXX {
#ifndef CXXBRIDGE1_STRUCT_CXX$RAfc2Backend
#define CXXBRIDGE1_STRUCT_CXX$RAfc2Backend
struct RAfc2Backend final : public ::rust::Opaque {
  ~RAfc2Backend() = delete;

private:
  friend ::rust::layout;
  struct layout {
    static ::std::size_t size() noexcept;
    static ::std::size_t align() noexcept;
  };
};
#endif // CXXBRIDGE1_STRUCT_CXX$RAfc2Backend

namespace cxx_qt_Afc2Backend {
#ifndef CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$Afc2BackendCxxQtThreadQueuedFn
#define CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$Afc2BackendCxxQtThreadQueuedFn
struct Afc2BackendCxxQtThreadQueuedFn final : public ::rust::Opaque {
  ~Afc2BackendCxxQtThreadQueuedFn() = delete;

private:
  friend ::rust::layout;
  struct layout {
    static ::std::size_t size() noexcept;
    static ::std::size_t align() noexcept;
  };
};
#endif // CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$Afc2BackendCxxQtThreadQueuedFn

#ifndef CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorBaseArguments0
#define CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorBaseArguments0
struct CxxQtConstructorBaseArguments0 final {
  ::std::int8_t not_empty CXX_DEFAULT_VALUE(0);

  using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorBaseArguments0

#ifndef CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorNewArguments0
#define CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorNewArguments0
struct CxxQtConstructorNewArguments0 final {
  ::QString arg0;

  using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorNewArguments0

#ifndef CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorInitializeArguments0
#define CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorInitializeArguments0
struct CxxQtConstructorInitializeArguments0 final {
  ::std::int8_t not_empty CXX_DEFAULT_VALUE(0);

  using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorInitializeArguments0

#ifndef CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorArguments0
#define CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorArguments0
struct CxxQtConstructorArguments0 final {
  ::CXX::cxx_qt_Afc2Backend::CxxQtConstructorBaseArguments0 base;
  ::CXX::cxx_qt_Afc2Backend::CxxQtConstructorNewArguments0 new_;
  ::CXX::cxx_qt_Afc2Backend::CxxQtConstructorInitializeArguments0 initialize;

  using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_CXX$cxx_qt_Afc2Backend$CxxQtConstructorArguments0
} // namespace cxx_qt_Afc2Backend
} // namespace CXX

static_assert(
    ::rust::IsRelocatable<::QString>::value,
    "type QString should be trivially move constructible and trivially destructible in C++ to be used as a field of `CxxQtConstructorNewArgumentsAfc2Backend0`, argument of `album_list_loaded`, `call_Afc2Backend_signal_handler_album_list_loaded`, `route_arguments_Afc2Backend_0` or return value of `start_video_stream` in Rust");
static_assert(
    ::rust::IsRelocatable<::QList_QString>::value,
    "type QList_QString should be trivially move constructible and trivially destructible in C++ to be used as an argument of `album_list_loaded`, `call_Afc2Backend_signal_handler_album_list_loaded` or return value of `list_dir`, `list_files_flat` in Rust");
static_assert(
    ::rust::IsRelocatable<::QByteArray>::value,
    "type QByteArray should be trivially move constructible and trivially destructible in C++ to be used as a return value of `file_to_buffer`, `read_file_range` in Rust");
static_assert(
    ::rust::IsRelocatable<::Qt::ConnectionType>::value,
    "type Qt::ConnectionType should be trivially move constructible and trivially destructible in C++ to be used as an argument of `Afc2Backend_connect_check_is_dir_and_list_finished`, `Afc2Backend_connect_album_list_loaded` in Rust");
static_assert(
    ::rust::IsRelocatable<::rust::cxxqt1::QMetaObjectConnection>::value,
    "type rust::cxxqt1::QMetaObjectConnection should be trivially move constructible and trivially destructible in C++ to be used as a return value of `Afc2Backend_connect_check_is_dir_and_list_finished`, `Afc2Backend_connect_album_list_loaded` in Rust");
static_assert(
    ::rust::IsRelocatable<::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandlercheck_is_dir_and_list_finished>::value,
    "type CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandlercheck_is_dir_and_list_finished should be trivially move constructible and trivially destructible in C++ to be used as an argument of `Afc2Backend_connect_check_is_dir_and_list_finished`, `drop_Afc2Backend_signal_handler_check_is_dir_and_list_finished` in Rust");
static_assert(
    ::rust::IsRelocatable<::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandleralbum_list_loaded>::value,
    "type CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandleralbum_list_loaded should be trivially move constructible and trivially destructible in C++ to be used as an argument of `Afc2Backend_connect_album_list_loaded`, `drop_Afc2Backend_signal_handler_album_list_loaded` in Rust");
static_assert(
    ::rust::IsRelocatable<::CXX::Afc2BackendCxxQtThread>::value,
    "type CXX::Afc2BackendCxxQtThread should be trivially move constructible and trivially destructible in C++ to be used as a return value of `cxx_qt_ffi_Afc2Backend_qtThread`, `cxx_qt_ffi_Afc2Backend_cxxQtThreadClone` in Rust");

namespace CXX {
extern "C" {
::std::size_t CXX$cxxbridge1$194$RAfc2Backend$operator$sizeof() noexcept;
::std::size_t CXX$cxxbridge1$194$RAfc2Backend$operator$alignof() noexcept;

void CXX$cxxbridge1$194$Afc2Backend$set_udid(::CXX::Afc2Backend &self, ::QString const &udid) noexcept;

void CXX$cxxbridge1$194$Afc2Backend$load_album_list(::CXX::Afc2Backend &self) noexcept;

void CXX$cxxbridge1$194$Afc2Backend$list_dir(::CXX::Afc2Backend const &self, ::QString const &path, ::QList_QString *return$) noexcept;

void CXX$cxxbridge1$194$Afc2Backend$file_to_buffer(::CXX::Afc2Backend const &self, ::QString const &file_path, ::QByteArray *return$) noexcept;

bool CXX$cxxbridge1$194$Afc2Backend$is_directory(::CXX::Afc2Backend const &self, ::QString const &path) noexcept;

::std::int64_t CXX$cxxbridge1$194$Afc2Backend$get_file_size(::CXX::Afc2Backend const &self, ::QString const &path) noexcept;

void CXX$cxxbridge1$194$Afc2Backend$read_file_range(::CXX::Afc2Backend const &self, ::QString const &path, ::std::int64_t offset, ::std::int64_t len, ::QByteArray *return$) noexcept;

void CXX$cxxbridge1$194$Afc2Backend$check_is_dir_and_list(::CXX::Afc2Backend const &self, ::QString const &path) noexcept;

::std::int64_t CXX$cxxbridge1$194$Afc2Backend$get_dirs_item_count(::CXX::Afc2Backend const &self, ::QList_QString const &dir) noexcept;

void CXX$cxxbridge1$194$Afc2Backend$list_files_flat(::CXX::Afc2Backend const &self, ::QString const &dir, ::QList_QString *return$) noexcept;

void CXX$cxxbridge1$194$Afc2Backend$start_video_stream(::CXX::Afc2Backend const &self, ::QString const &file_path, ::QString *return$) noexcept;

bool CXX$cxxbridge1$194$Afc2Backend$is_available(::CXX::Afc2Backend const &self) noexcept;

bool CXX$cxxbridge1$194$Afc2Backend$delete_path(::CXX::Afc2Backend const &self, ::QString const &path) noexcept;

void CXX$cxxbridge1$194$Afc2Backend$check_is_dir_and_list_finished(::CXX::Afc2Backend &self, bool success, ::QMap_QString_QVariant const &entries) noexcept {
  void (::CXX::Afc2Backend::*check_is_dir_and_list_finished$)(bool, ::QMap_QString_QVariant const &) = &::CXX::Afc2Backend::check_is_dir_and_list_finished;
  (self.*check_is_dir_and_list_finished$)(success, entries);
}
} // extern "C"

namespace rust {
namespace cxxqtgen1 {
extern "C" {
void CXX$rust$cxxqtgen1$cxxbridge1$194$Afc2Backend_connect_check_is_dir_and_list_finished(::CXX::Afc2Backend &self_value, ::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandlercheck_is_dir_and_list_finished *signal_handler, ::Qt::ConnectionType *conn_type, ::rust::cxxqt1::QMetaObjectConnection *return$) noexcept {
  ::rust::cxxqt1::QMetaObjectConnection (*Afc2Backend_connect_check_is_dir_and_list_finished$)(::CXX::Afc2Backend &, ::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandlercheck_is_dir_and_list_finished, ::Qt::ConnectionType) = ::CXX::rust::cxxqtgen1::Afc2Backend_check_is_dir_and_list_finishedConnect;
  new (return$) ::rust::cxxqt1::QMetaObjectConnection(Afc2Backend_connect_check_is_dir_and_list_finished$(self_value, ::std::move(*signal_handler), ::std::move(*conn_type)));
}

void CXX$rust$cxxqtgen1$cxxbridge1$194$drop_Afc2Backend_signal_handler_check_is_dir_and_list_finished(::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandlercheck_is_dir_and_list_finished *handler) noexcept;

void CXX$rust$cxxqtgen1$cxxbridge1$194$call_Afc2Backend_signal_handler_check_is_dir_and_list_finished(::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandlercheck_is_dir_and_list_finished &handler, ::CXX::Afc2Backend &self_value, bool success, ::QMap_QString_QVariant const &entries) noexcept;
} // extern "C"
} // namespace cxxqtgen1
} // namespace rust

extern "C" {
void CXX$cxxbridge1$194$Afc2Backend$album_list_loaded(::CXX::Afc2Backend &self, ::QString *udid, ::QList_QString *album_list) noexcept {
  void (::CXX::Afc2Backend::*album_list_loaded$)(::QString, ::QList_QString) = &::CXX::Afc2Backend::album_list_loaded;
  (self.*album_list_loaded$)(::std::move(*udid), ::std::move(*album_list));
}
} // extern "C"

namespace rust {
namespace cxxqtgen1 {
extern "C" {
void CXX$rust$cxxqtgen1$cxxbridge1$194$Afc2Backend_connect_album_list_loaded(::CXX::Afc2Backend &self_value, ::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandleralbum_list_loaded *signal_handler, ::Qt::ConnectionType *conn_type, ::rust::cxxqt1::QMetaObjectConnection *return$) noexcept {
  ::rust::cxxqt1::QMetaObjectConnection (*Afc2Backend_connect_album_list_loaded$)(::CXX::Afc2Backend &, ::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandleralbum_list_loaded, ::Qt::ConnectionType) = ::CXX::rust::cxxqtgen1::Afc2Backend_album_list_loadedConnect;
  new (return$) ::rust::cxxqt1::QMetaObjectConnection(Afc2Backend_connect_album_list_loaded$(self_value, ::std::move(*signal_handler), ::std::move(*conn_type)));
}

void CXX$rust$cxxqtgen1$cxxbridge1$194$drop_Afc2Backend_signal_handler_album_list_loaded(::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandleralbum_list_loaded *handler) noexcept;

void CXX$rust$cxxqtgen1$cxxbridge1$194$call_Afc2Backend_signal_handler_album_list_loaded(::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandleralbum_list_loaded &handler, ::CXX::Afc2Backend &self_value, ::QString *udid, ::QList_QString *album_list) noexcept;
} // extern "C"
} // namespace cxxqtgen1
} // namespace rust
} // namespace CXX

namespace rust {
namespace cxxqt1 {
extern "C" {
void rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_qtThread(::CXX::Afc2Backend const &qobject, ::CXX::Afc2BackendCxxQtThread *return$) noexcept {
  ::CXX::Afc2BackendCxxQtThread (*cxx_qt_ffi_Afc2Backend_qtThread$)(::CXX::Afc2Backend const &) = ::rust::cxxqt1::qtThread;
  new (return$) ::CXX::Afc2BackendCxxQtThread(cxx_qt_ffi_Afc2Backend_qtThread$(qobject));
}

::std::uint8_t rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_cxxQtThreadQueue(::CXX::Afc2BackendCxxQtThread const &cxx_qt_thread, ::rust::Fn<void(::CXX::Afc2Backend &, ::rust::Box<::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn>)> func, ::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn *arg) noexcept {
  ::std::uint8_t (*cxx_qt_ffi_Afc2Backend_cxxQtThreadQueue$)(::CXX::Afc2BackendCxxQtThread const &, ::rust::Fn<void(::CXX::Afc2Backend &, ::rust::Box<::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn>)>, ::rust::Box<::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn>) = ::rust::cxxqt1::cxxQtThreadQueue;
  return cxx_qt_ffi_Afc2Backend_cxxQtThreadQueue$(cxx_qt_thread, func, ::rust::Box<::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn>::from_raw(arg));
}

void rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_cxxQtThreadQueue$func$1(::CXX::Afc2Backend &arg0, ::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn *arg1, void *) noexcept;

void rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_cxxQtThreadQueue$func$0(::CXX::Afc2Backend &arg0, ::rust::Box<::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn> arg1, void *extern$) noexcept {
  rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_cxxQtThreadQueue$func$1(arg0, arg1.into_raw(), extern$);
}

void rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_cxxQtThreadClone(::CXX::Afc2BackendCxxQtThread const &cxx_qt_thread, ::CXX::Afc2BackendCxxQtThread *return$) noexcept {
  ::CXX::Afc2BackendCxxQtThread (*cxx_qt_ffi_Afc2Backend_cxxQtThreadClone$)(::CXX::Afc2BackendCxxQtThread const &) = ::rust::cxxqt1::cxxQtThreadClone;
  new (return$) ::CXX::Afc2BackendCxxQtThread(cxx_qt_ffi_Afc2Backend_cxxQtThreadClone$(cxx_qt_thread));
}

void rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_cxxQtThreadDrop(::CXX::Afc2BackendCxxQtThread &cxx_qt_thread) noexcept {
  void (*cxx_qt_ffi_Afc2Backend_cxxQtThreadDrop$)(::CXX::Afc2BackendCxxQtThread &) = ::rust::cxxqt1::cxxQtThreadDrop;
  cxx_qt_ffi_Afc2Backend_cxxQtThreadDrop$(cxx_qt_thread);
}

bool rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_cxxQtThreadIsDestroyed(::CXX::Afc2BackendCxxQtThread const &cxx_qt_thread) noexcept {
  bool (*cxx_qt_ffi_Afc2Backend_cxxQtThreadIsDestroyed$)(::CXX::Afc2BackendCxxQtThread const &) = ::rust::cxxqt1::cxxQtThreadIsDestroyed;
  return cxx_qt_ffi_Afc2Backend_cxxQtThreadIsDestroyed$(cxx_qt_thread);
}
} // extern "C"
} // namespace cxxqt1
} // namespace rust

namespace CXX {
namespace cxx_qt_Afc2Backend {
extern "C" {
::std::size_t CXX$cxx_qt_Afc2Backend$cxxbridge1$194$Afc2BackendCxxQtThreadQueuedFn$operator$sizeof() noexcept;
::std::size_t CXX$cxx_qt_Afc2Backend$cxxbridge1$194$Afc2BackendCxxQtThreadQueuedFn$operator$alignof() noexcept;
} // extern "C"
} // namespace cxx_qt_Afc2Backend
} // namespace CXX

namespace rust {
namespace cxxqt1 {
extern "C" {
::QObject const *rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_upcastPtr(::CXX::Afc2Backend const *thiz) noexcept {
  ::QObject const *(*cxx_qt_ffi_Afc2Backend_upcastPtr$)(::CXX::Afc2Backend const *) = ::rust::cxxqt1::upcastPtr;
  return cxx_qt_ffi_Afc2Backend_upcastPtr$(thiz);
}

::CXX::Afc2Backend const *rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_downcastPtr(::QObject const *base) noexcept {
  ::CXX::Afc2Backend const *(*cxx_qt_ffi_Afc2Backend_downcastPtr$)(::QObject const *) = ::rust::cxxqt1::downcastPtr;
  return cxx_qt_ffi_Afc2Backend_downcastPtr$(base);
}
} // extern "C"
} // namespace cxxqt1
} // namespace rust

namespace CXX {
namespace cxx_qt_Afc2Backend {
extern "C" {
void CXX$cxx_qt_Afc2Backend$cxxbridge1$194$route_arguments_Afc2Backend_0(::QString *arg0, ::CXX::cxx_qt_Afc2Backend::CxxQtConstructorArguments0 *return$) noexcept;

::CXX::RAfc2Backend *CXX$cxx_qt_Afc2Backend$cxxbridge1$194$new_rs_Afc2Backend_0(::CXX::cxx_qt_Afc2Backend::CxxQtConstructorNewArguments0 *args) noexcept;

void CXX$cxx_qt_Afc2Backend$cxxbridge1$194$initialize_Afc2Backend_0(::CXX::Afc2Backend &qobject, ::CXX::cxx_qt_Afc2Backend::CxxQtConstructorInitializeArguments0 *args) noexcept;
} // extern "C"
} // namespace cxx_qt_Afc2Backend
} // namespace CXX

namespace rust {
namespace cxxqt1 {
extern "C" {
void rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_unsafeRust(::CXX::Afc2Backend const &outer, ::CXX::RAfc2Backend const **return$) noexcept {
  ::CXX::RAfc2Backend const &(*cxx_qt_ffi_Afc2Backend_unsafeRust$)(::CXX::Afc2Backend const &) = ::rust::cxxqt1::unsafeRust;
  new (return$) ::CXX::RAfc2Backend const *(&cxx_qt_ffi_Afc2Backend_unsafeRust$(outer));
}

void rust$cxxqt1$cxxbridge1$194$cxx_qt_ffi_Afc2Backend_unsafeRustMut(::CXX::Afc2Backend &outer, ::CXX::RAfc2Backend **return$) noexcept {
  ::CXX::RAfc2Backend &(*cxx_qt_ffi_Afc2Backend_unsafeRustMut$)(::CXX::Afc2Backend &) = ::rust::cxxqt1::unsafeRustMut;
  new (return$) ::CXX::RAfc2Backend *(&cxx_qt_ffi_Afc2Backend_unsafeRustMut$(outer));
}
} // extern "C"
} // namespace cxxqt1
} // namespace rust

namespace CXX {
::std::size_t RAfc2Backend::layout::size() noexcept {
  return CXX$cxxbridge1$194$RAfc2Backend$operator$sizeof();
}

::std::size_t RAfc2Backend::layout::align() noexcept {
  return CXX$cxxbridge1$194$RAfc2Backend$operator$alignof();
}

void Afc2Backend::set_udid(::QString const &udid) noexcept {
  CXX$cxxbridge1$194$Afc2Backend$set_udid(*this, udid);
}

void Afc2Backend::load_album_list() noexcept {
  CXX$cxxbridge1$194$Afc2Backend$load_album_list(*this);
}

::QList_QString Afc2Backend::list_dir(::QString const &path) const noexcept {
  ::rust::MaybeUninit<::QList_QString> return$;
  CXX$cxxbridge1$194$Afc2Backend$list_dir(*this, path, &return$.value);
  return ::std::move(return$.value);
}

::QByteArray Afc2Backend::file_to_buffer(::QString const &file_path) const noexcept {
  ::rust::MaybeUninit<::QByteArray> return$;
  CXX$cxxbridge1$194$Afc2Backend$file_to_buffer(*this, file_path, &return$.value);
  return ::std::move(return$.value);
}

bool Afc2Backend::is_directory(::QString const &path) const noexcept {
  return CXX$cxxbridge1$194$Afc2Backend$is_directory(*this, path);
}

::std::int64_t Afc2Backend::get_file_size(::QString const &path) const noexcept {
  return CXX$cxxbridge1$194$Afc2Backend$get_file_size(*this, path);
}

::QByteArray Afc2Backend::read_file_range(::QString const &path, ::std::int64_t offset, ::std::int64_t len) const noexcept {
  ::rust::MaybeUninit<::QByteArray> return$;
  CXX$cxxbridge1$194$Afc2Backend$read_file_range(*this, path, offset, len, &return$.value);
  return ::std::move(return$.value);
}

void Afc2Backend::check_is_dir_and_list(::QString const &path) const noexcept {
  CXX$cxxbridge1$194$Afc2Backend$check_is_dir_and_list(*this, path);
}

::std::int64_t Afc2Backend::get_dirs_item_count(::QList_QString const &dir) const noexcept {
  return CXX$cxxbridge1$194$Afc2Backend$get_dirs_item_count(*this, dir);
}

::QList_QString Afc2Backend::list_files_flat(::QString const &dir) const noexcept {
  ::rust::MaybeUninit<::QList_QString> return$;
  CXX$cxxbridge1$194$Afc2Backend$list_files_flat(*this, dir, &return$.value);
  return ::std::move(return$.value);
}

::QString Afc2Backend::start_video_stream(::QString const &file_path) const noexcept {
  ::rust::MaybeUninit<::QString> return$;
  CXX$cxxbridge1$194$Afc2Backend$start_video_stream(*this, file_path, &return$.value);
  return ::std::move(return$.value);
}

bool Afc2Backend::is_available() const noexcept {
  return CXX$cxxbridge1$194$Afc2Backend$is_available(*this);
}

bool Afc2Backend::delete_path(::QString const &path) const noexcept {
  return CXX$cxxbridge1$194$Afc2Backend$delete_path(*this, path);
}

namespace rust {
namespace cxxqtgen1 {
void drop_Afc2Backend_signal_handler_check_is_dir_and_list_finished(::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandlercheck_is_dir_and_list_finished handler) noexcept {
  ::rust::ManuallyDrop<::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandlercheck_is_dir_and_list_finished> handler$(::std::move(handler));
  CXX$rust$cxxqtgen1$cxxbridge1$194$drop_Afc2Backend_signal_handler_check_is_dir_and_list_finished(&handler$.value);
}

void call_Afc2Backend_signal_handler_check_is_dir_and_list_finished(::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandlercheck_is_dir_and_list_finished &handler, ::CXX::Afc2Backend &self_value, bool success, ::QMap_QString_QVariant const &entries) noexcept {
  CXX$rust$cxxqtgen1$cxxbridge1$194$call_Afc2Backend_signal_handler_check_is_dir_and_list_finished(handler, self_value, success, entries);
}

void drop_Afc2Backend_signal_handler_album_list_loaded(::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandleralbum_list_loaded handler) noexcept {
  ::rust::ManuallyDrop<::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandleralbum_list_loaded> handler$(::std::move(handler));
  CXX$rust$cxxqtgen1$cxxbridge1$194$drop_Afc2Backend_signal_handler_album_list_loaded(&handler$.value);
}

void call_Afc2Backend_signal_handler_album_list_loaded(::CXX::rust::cxxqtgen1::Afc2BackendCxxQtSignalHandleralbum_list_loaded &handler, ::CXX::Afc2Backend &self_value, ::QString udid, ::QList_QString album_list) noexcept {
  ::rust::ManuallyDrop<::QString> udid$(::std::move(udid));
  ::rust::ManuallyDrop<::QList_QString> album_list$(::std::move(album_list));
  CXX$rust$cxxqtgen1$cxxbridge1$194$call_Afc2Backend_signal_handler_album_list_loaded(handler, self_value, &udid$.value, &album_list$.value);
}
} // namespace cxxqtgen1
} // namespace rust

namespace cxx_qt_Afc2Backend {
::std::size_t Afc2BackendCxxQtThreadQueuedFn::layout::size() noexcept {
  return CXX$cxx_qt_Afc2Backend$cxxbridge1$194$Afc2BackendCxxQtThreadQueuedFn$operator$sizeof();
}

::std::size_t Afc2BackendCxxQtThreadQueuedFn::layout::align() noexcept {
  return CXX$cxx_qt_Afc2Backend$cxxbridge1$194$Afc2BackendCxxQtThreadQueuedFn$operator$alignof();
}

::CXX::cxx_qt_Afc2Backend::CxxQtConstructorArguments0 routeArguments0(::QString arg0) noexcept {
  ::rust::ManuallyDrop<::QString> arg0$(::std::move(arg0));
  ::rust::MaybeUninit<::CXX::cxx_qt_Afc2Backend::CxxQtConstructorArguments0> return$;
  CXX$cxx_qt_Afc2Backend$cxxbridge1$194$route_arguments_Afc2Backend_0(&arg0$.value, &return$.value);
  return ::std::move(return$.value);
}

::rust::Box<::CXX::RAfc2Backend> newRs0(::CXX::cxx_qt_Afc2Backend::CxxQtConstructorNewArguments0 args) noexcept {
  ::rust::ManuallyDrop<::CXX::cxx_qt_Afc2Backend::CxxQtConstructorNewArguments0> args$(::std::move(args));
  return ::rust::Box<::CXX::RAfc2Backend>::from_raw(CXX$cxx_qt_Afc2Backend$cxxbridge1$194$new_rs_Afc2Backend_0(&args$.value));
}

void initialize0(::CXX::Afc2Backend &qobject, ::CXX::cxx_qt_Afc2Backend::CxxQtConstructorInitializeArguments0 args) noexcept {
  ::rust::ManuallyDrop<::CXX::cxx_qt_Afc2Backend::CxxQtConstructorInitializeArguments0> args$(::std::move(args));
  CXX$cxx_qt_Afc2Backend$cxxbridge1$194$initialize_Afc2Backend_0(qobject, &args$.value);
}
} // namespace cxx_qt_Afc2Backend
} // namespace CXX

extern "C" {
::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn *cxxbridge1$box$CXX$cxx_qt_Afc2Backend$Afc2BackendCxxQtThreadQueuedFn$alloc() noexcept;
void cxxbridge1$box$CXX$cxx_qt_Afc2Backend$Afc2BackendCxxQtThreadQueuedFn$dealloc(::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn *) noexcept;
void cxxbridge1$box$CXX$cxx_qt_Afc2Backend$Afc2BackendCxxQtThreadQueuedFn$drop(::rust::Box<::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn> *ptr) noexcept;

::CXX::RAfc2Backend *cxxbridge1$box$CXX$RAfc2Backend$alloc() noexcept;
void cxxbridge1$box$CXX$RAfc2Backend$dealloc(::CXX::RAfc2Backend *) noexcept;
void cxxbridge1$box$CXX$RAfc2Backend$drop(::rust::Box<::CXX::RAfc2Backend> *ptr) noexcept;
} // extern "C"

namespace rust {
inline namespace cxxbridge1 {
template <>
::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn *Box<::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn>::allocation::alloc() noexcept {
  return cxxbridge1$box$CXX$cxx_qt_Afc2Backend$Afc2BackendCxxQtThreadQueuedFn$alloc();
}
template <>
void Box<::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn>::allocation::dealloc(::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn *ptr) noexcept {
  cxxbridge1$box$CXX$cxx_qt_Afc2Backend$Afc2BackendCxxQtThreadQueuedFn$dealloc(ptr);
}
template <>
void Box<::CXX::cxx_qt_Afc2Backend::Afc2BackendCxxQtThreadQueuedFn>::drop() noexcept {
  cxxbridge1$box$CXX$cxx_qt_Afc2Backend$Afc2BackendCxxQtThreadQueuedFn$drop(this);
}
template <>
::CXX::RAfc2Backend *Box<::CXX::RAfc2Backend>::allocation::alloc() noexcept {
  return cxxbridge1$box$CXX$RAfc2Backend$alloc();
}
template <>
void Box<::CXX::RAfc2Backend>::allocation::dealloc(::CXX::RAfc2Backend *ptr) noexcept {
  cxxbridge1$box$CXX$RAfc2Backend$dealloc(ptr);
}
template <>
void Box<::CXX::RAfc2Backend>::drop() noexcept {
  cxxbridge1$box$CXX$RAfc2Backend$drop(this);
}
} // namespace cxxbridge1
} // namespace rust
