mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 02:41:59 +00:00
82aaad61aa
Note, that it can the fail the client if the skim itself will fail, however I haven't seen it panicd, so let's try. P.S. about adding USE_SKIM into configure header instead of just compile option for target, it is better, because it allows not to recompile lots of C++ headers, since we have to add skim library as PUBLIC. But anyway this will be resolved in a different way, but separatelly. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
91 lines
2.4 KiB
C++
91 lines
2.4 KiB
C++
/// This header was compiled with:
|
|
///
|
|
/// $ cxxbridge rust/skim/src/lib.rs --header
|
|
///
|
|
/// For more info [1].
|
|
///
|
|
/// [1]: https://cxx.rs/build/other.html
|
|
|
|
#pragma once
|
|
#include <array>
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace rust {
|
|
inline namespace cxxbridge1 {
|
|
// #include "rust/cxx.h"
|
|
|
|
struct unsafe_bitcopy_t;
|
|
|
|
#ifndef CXXBRIDGE1_RUST_STRING
|
|
#define CXXBRIDGE1_RUST_STRING
|
|
class String final {
|
|
public:
|
|
String() noexcept;
|
|
String(const String &) noexcept;
|
|
String(String &&) noexcept;
|
|
~String() noexcept;
|
|
|
|
String(const std::string &);
|
|
String(const char *);
|
|
String(const char *, std::size_t);
|
|
String(const char16_t *);
|
|
String(const char16_t *, std::size_t);
|
|
|
|
static String lossy(const std::string &) noexcept;
|
|
static String lossy(const char *) noexcept;
|
|
static String lossy(const char *, std::size_t) noexcept;
|
|
static String lossy(const char16_t *) noexcept;
|
|
static String lossy(const char16_t *, std::size_t) noexcept;
|
|
|
|
String &operator=(const String &) &noexcept;
|
|
String &operator=(String &&) &noexcept;
|
|
|
|
explicit operator std::string() const;
|
|
|
|
const char *data() const noexcept;
|
|
std::size_t size() const noexcept;
|
|
std::size_t length() const noexcept;
|
|
bool empty() const noexcept;
|
|
|
|
const char *c_str() noexcept;
|
|
|
|
std::size_t capacity() const noexcept;
|
|
void reserve(size_t new_cap) noexcept;
|
|
|
|
using iterator = char *;
|
|
iterator begin() noexcept;
|
|
iterator end() noexcept;
|
|
|
|
using const_iterator = const char *;
|
|
const_iterator begin() const noexcept;
|
|
const_iterator end() const noexcept;
|
|
const_iterator cbegin() const noexcept;
|
|
const_iterator cend() const noexcept;
|
|
|
|
bool operator==(const String &) const noexcept;
|
|
bool operator!=(const String &) const noexcept;
|
|
bool operator<(const String &) const noexcept;
|
|
bool operator<=(const String &) const noexcept;
|
|
bool operator>(const String &) const noexcept;
|
|
bool operator>=(const String &) const noexcept;
|
|
|
|
void swap(String &) noexcept;
|
|
|
|
String(unsafe_bitcopy_t, const String &) noexcept;
|
|
|
|
private:
|
|
struct lossy_t;
|
|
String(lossy_t, const char *, std::size_t) noexcept;
|
|
String(lossy_t, const char16_t *, std::size_t) noexcept;
|
|
friend void swap(String &lhs, String &rhs) noexcept { lhs.swap(rhs); }
|
|
|
|
std::array<std::uintptr_t, 3> repr;
|
|
};
|
|
#endif // CXXBRIDGE1_RUST_STRING
|
|
} // namespace cxxbridge1
|
|
} // namespace rust
|
|
|
|
::rust::String skim(::std::vector<::std::string> const &words) noexcept;
|