Skip to content

Instantly share code, notes, and snippets.

@sayrer
Created March 23, 2021 17:08
Show Gist options
  • Save sayrer/d084cd5d5c989fc9f0e93c15cdc32de5 to your computer and use it in GitHub Desktop.
Save sayrer/d084cd5d5c989fc9f0e93c15cdc32de5 to your computer and use it in GitHub Desktop.
cxx-generated header
#pragma once
#include "cxx.h"
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <initializer_list>
#include <iterator>
#include <memory>
#include <new>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
namespace rust {
inline namespace cxxbridge1 {
// #include "rust/cxx.h"
#ifndef CXXBRIDGE1_PANIC
#define CXXBRIDGE1_PANIC
template <typename Exception>
void panic [[noreturn]] (const char *msg);
#endif // CXXBRIDGE1_PANIC
struct unsafe_bitcopy_t;
namespace {
template <typename T>
class impl;
} // namespace
#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 &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;
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;
String(unsafe_bitcopy_t, const String &) noexcept;
private:
std::array<std::uintptr_t, 3> repr;
};
#endif // CXXBRIDGE1_RUST_STRING
#ifndef CXXBRIDGE1_RUST_STR
#define CXXBRIDGE1_RUST_STR
class Str final {
public:
Str() noexcept;
Str(const String &) noexcept;
Str(const std::string &);
Str(const char *);
Str(const char *, std::size_t);
Str &operator=(const Str &) noexcept = default;
explicit operator std::string() const;
const char *data() const noexcept;
std::size_t size() const noexcept;
std::size_t length() const noexcept;
Str(const Str &) noexcept = default;
~Str() noexcept = default;
using iterator = const char *;
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 Str &) const noexcept;
bool operator!=(const Str &) const noexcept;
bool operator<(const Str &) const noexcept;
bool operator<=(const Str &) const noexcept;
bool operator>(const Str &) const noexcept;
bool operator>=(const Str &) const noexcept;
private:
friend impl<Str>;
const char *ptr;
std::size_t len;
};
inline const char *Str::data() const noexcept { return this->ptr; }
inline std::size_t Str::size() const noexcept { return this->len; }
inline std::size_t Str::length() const noexcept { return this->len; }
#endif // CXXBRIDGE1_RUST_STR
#ifndef CXXBRIDGE1_RUST_BOX
#define CXXBRIDGE1_RUST_BOX
template <typename T>
class Box final {
public:
using value_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(const Box &);
Box(Box &&) noexcept;
~Box() noexcept;
explicit Box(const T &);
explicit Box(T &&);
Box &operator=(const Box &);
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 &&...);
static Box from_raw(T *) noexcept;
T *into_raw() noexcept;
private:
class uninit;
class allocation;
Box(uninit) noexcept;
void drop() noexcept;
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(const Box &other) : Box(*other) {}
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=(const Box &other) {
if (this->ptr) {
**this = *other;
} else {
allocation alloc;
::new (alloc.ptr) T(*other);
this->ptr = alloc.ptr;
alloc.ptr = nullptr;
}
return *this;
}
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>
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_BITCOPY
#define CXXBRIDGE1_RUST_BITCOPY
struct unsafe_bitcopy_t final {
explicit unsafe_bitcopy_t() = default;
};
constexpr unsafe_bitcopy_t unsafe_bitcopy{};
#endif // CXXBRIDGE1_RUST_BITCOPY
#ifndef CXXBRIDGE1_RUST_VEC
#define CXXBRIDGE1_RUST_VEC
template <typename T>
class Vec final {
public:
using value_type = T;
Vec() noexcept;
Vec(std::initializer_list<T>);
Vec(const Vec &);
Vec(Vec &&) noexcept;
~Vec() noexcept;
Vec &operator=(Vec &&) noexcept;
Vec &operator=(const Vec &);
std::size_t size() const noexcept;
bool empty() const noexcept;
const T *data() const noexcept;
T *data() noexcept;
std::size_t capacity() const noexcept;
const T &operator[](std::size_t n) const noexcept;
const T &at(std::size_t n) const;
const T &front() const;
const T &back() const;
T &operator[](std::size_t n) noexcept;
T &at(std::size_t n);
T &front();
T &back();
void reserve(std::size_t new_cap);
void push_back(const T &value);
void push_back(T &&value);
template <typename... Args>
void emplace_back(Args &&... args);
class iterator;
iterator begin() noexcept;
iterator end() noexcept;
using const_iterator = typename Vec<const T>::iterator;
const_iterator begin() const noexcept;
const_iterator end() const noexcept;
const_iterator cbegin() const noexcept;
const_iterator cend() const noexcept;
Vec(unsafe_bitcopy_t, const Vec &) noexcept;
private:
static std::size_t stride() noexcept;
void reserve_total(std::size_t cap) noexcept;
void set_len(std::size_t len) noexcept;
void drop() noexcept;
std::array<std::uintptr_t, 3> repr;
};
template <typename T>
class Vec<T>::iterator final {
public:
using iterator_category = std::random_access_iterator_tag;
using value_type = T;
using difference_type = std::ptrdiff_t;
using pointer = typename std::add_pointer<T>::type;
using reference = typename std::add_lvalue_reference<T>::type;
reference operator*() const noexcept;
pointer operator->() const noexcept;
reference operator[](difference_type) const noexcept;
iterator &operator++() noexcept;
iterator operator++(int) noexcept;
iterator &operator--() noexcept;
iterator operator--(int) noexcept;
iterator &operator+=(difference_type) noexcept;
iterator &operator-=(difference_type) noexcept;
iterator operator+(difference_type) const noexcept;
iterator operator-(difference_type) const noexcept;
difference_type operator-(const iterator &) const noexcept;
bool operator==(const iterator &) const noexcept;
bool operator!=(const iterator &) const noexcept;
bool operator<(const iterator &) const noexcept;
bool operator>(const iterator &) const noexcept;
bool operator<=(const iterator &) const noexcept;
bool operator>=(const iterator &) const noexcept;
private:
friend class Vec;
friend class Vec<typename std::remove_const<T>::type>;
void *pos;
std::size_t stride;
};
template <typename T>
Vec<T>::Vec(std::initializer_list<T> init) : Vec{} {
this->reserve_total(init.size());
std::move(init.begin(), init.end(), std::back_inserter(*this));
}
template <typename T>
Vec<T>::Vec(const Vec &other) : Vec() {
this->reserve_total(other.size());
std::copy(other.begin(), other.end(), std::back_inserter(*this));
}
template <typename T>
Vec<T>::Vec(Vec &&other) noexcept : repr(other.repr) {
new (&other) Vec();
}
template <typename T>
Vec<T>::~Vec() noexcept {
this->drop();
}
template <typename T>
Vec<T> &Vec<T>::operator=(Vec &&other) noexcept {
if (this != &other) {
this->drop();
this->repr = other.repr;
new (&other) Vec();
}
return *this;
}
template <typename T>
Vec<T> &Vec<T>::operator=(const Vec &other) {
if (this != &other) {
this->drop();
new (this) Vec(other);
}
return *this;
}
template <typename T>
bool Vec<T>::empty() const noexcept {
return size() == 0;
}
template <typename T>
T *Vec<T>::data() noexcept {
return const_cast<T *>(const_cast<const Vec<T> *>(this)->data());
}
template <typename T>
const T &Vec<T>::operator[](std::size_t n) const noexcept {
auto data = reinterpret_cast<const char *>(this->data());
return *reinterpret_cast<const T *>(data + n * this->stride());
}
template <typename T>
const T &Vec<T>::at(std::size_t n) const {
if (n >= this->size()) {
panic<std::out_of_range>("rust::Vec index out of range");
}
return (*this)[n];
}
template <typename T>
const T &Vec<T>::front() const {
return (*this)[0];
}
template <typename T>
const T &Vec<T>::back() const {
return (*this)[this->size() - 1];
}
template <typename T>
T &Vec<T>::operator[](std::size_t n) noexcept {
auto data = reinterpret_cast<char *>(this->data());
return *reinterpret_cast<T *>(data + n * this->stride());
}
template <typename T>
T &Vec<T>::at(std::size_t n) {
if (n >= this->size()) {
panic<std::out_of_range>("rust::Vec index out of range");
}
return (*this)[n];
}
template <typename T>
T &Vec<T>::front() {
return (*this)[0];
}
template <typename T>
T &Vec<T>::back() {
return (*this)[this->size() - 1];
}
template <typename T>
void Vec<T>::reserve(std::size_t new_cap) {
this->reserve_total(new_cap);
}
template <typename T>
void Vec<T>::push_back(const T &value) {
this->emplace_back(value);
}
template <typename T>
void Vec<T>::push_back(T &&value) {
this->emplace_back(std::move(value));
}
template <typename T>
template <typename... Args>
void Vec<T>::emplace_back(Args &&... args) {
auto size = this->size();
this->reserve_total(size + 1);
::new (reinterpret_cast<T *>(reinterpret_cast<char *>(this->data()) +
size * this->stride()))
T(std::forward<Args>(args)...);
this->set_len(size + 1);
}
template <typename T>
typename Vec<T>::iterator::reference
Vec<T>::iterator::operator*() const noexcept {
return *static_cast<T *>(this->pos);
}
template <typename T>
typename Vec<T>::iterator::pointer
Vec<T>::iterator::operator->() const noexcept {
return static_cast<T *>(this->pos);
}
template <typename T>
typename Vec<T>::iterator::reference Vec<T>::iterator::operator[](
typename Vec<T>::iterator::difference_type n) const noexcept {
auto pos = static_cast<char *>(this->pos) + this->stride * n;
return *static_cast<T *>(pos);
}
template <typename T>
typename Vec<T>::iterator &Vec<T>::iterator::operator++() noexcept {
this->pos = static_cast<char *>(this->pos) + this->stride;
return *this;
}
template <typename T>
typename Vec<T>::iterator Vec<T>::iterator::operator++(int) noexcept {
auto ret = iterator(*this);
this->pos = static_cast<char *>(this->pos) + this->stride;
return ret;
}
template <typename T>
typename Vec<T>::iterator &Vec<T>::iterator::operator--() noexcept {
this->pos = static_cast<char *>(this->pos) - this->stride;
return *this;
}
template <typename T>
typename Vec<T>::iterator Vec<T>::iterator::operator--(int) noexcept {
auto ret = iterator(*this);
this->pos = static_cast<char *>(this->pos) - this->stride;
return ret;
}
template <typename T>
typename Vec<T>::iterator &Vec<T>::iterator::operator+=(
typename Vec<T>::iterator::difference_type n) noexcept {
this->pos = static_cast<char *>(this->pos) + this->stride * n;
return *this;
}
template <typename T>
typename Vec<T>::iterator &Vec<T>::iterator::operator-=(
typename Vec<T>::iterator::difference_type n) noexcept {
this->pos = static_cast<char *>(this->pos) - this->stride * n;
return *this;
}
template <typename T>
typename Vec<T>::iterator Vec<T>::iterator::operator+(
typename Vec<T>::iterator::difference_type n) const noexcept {
auto ret = iterator(*this);
ret.pos = static_cast<char *>(this->pos) + this->stride * n;
return ret;
}
template <typename T>
typename Vec<T>::iterator Vec<T>::iterator::operator-(
typename Vec<T>::iterator::difference_type n) const noexcept {
auto ret = iterator(*this);
ret.pos = static_cast<char *>(this->pos) - this->stride * n;
return ret;
}
template <typename T>
typename Vec<T>::iterator::difference_type
Vec<T>::iterator::operator-(const iterator &other) const noexcept {
auto diff = std::distance(static_cast<char *>(other.pos),
static_cast<char *>(this->pos));
return diff / this->stride;
}
template <typename T>
bool Vec<T>::iterator::operator==(const iterator &other) const noexcept {
return this->pos == other.pos;
}
template <typename T>
bool Vec<T>::iterator::operator!=(const iterator &other) const noexcept {
return this->pos != other.pos;
}
template <typename T>
bool Vec<T>::iterator::operator>(const iterator &other) const noexcept {
return this->pos > other.pos;
}
template <typename T>
bool Vec<T>::iterator::operator<(const iterator &other) const noexcept {
return this->pos < other.pos;
}
template <typename T>
bool Vec<T>::iterator::operator>=(const iterator &other) const noexcept {
return this->pos >= other.pos;
}
template <typename T>
bool Vec<T>::iterator::operator<=(const iterator &other) const noexcept {
return this->pos <= other.pos;
}
template <typename T>
typename Vec<T>::iterator Vec<T>::begin() noexcept {
iterator it;
it.pos = const_cast<typename std::remove_const<T>::type *>(this->data());
it.stride = this->stride();
return it;
}
template <typename T>
typename Vec<T>::iterator Vec<T>::end() noexcept {
iterator it = this->begin();
it.pos = static_cast<char *>(it.pos) + it.stride * this->size();
return it;
}
template <typename T>
typename Vec<T>::const_iterator Vec<T>::begin() const noexcept {
return this->cbegin();
}
template <typename T>
typename Vec<T>::const_iterator Vec<T>::end() const noexcept {
return this->cend();
}
template <typename T>
typename Vec<T>::const_iterator Vec<T>::cbegin() const noexcept {
const_iterator it;
it.pos = const_cast<typename std::remove_const<T>::type *>(this->data());
it.stride = this->stride();
return it;
}
template <typename T>
typename Vec<T>::const_iterator Vec<T>::cend() const noexcept {
const_iterator it = this->cbegin();
it.pos = static_cast<char *>(it.pos) + it.stride * this->size();
return it;
}
template <typename T>
Vec<T>::Vec(unsafe_bitcopy_t, const Vec &bits) noexcept : repr(bits.repr) {}
#endif // CXXBRIDGE1_RUST_VEC
} // namespace cxxbridge1
} // namespace rust
namespace twitter_text {
struct Range;
struct WeightedRange;
struct Configuration;
struct AutolinkerConfig;
struct Hit;
struct Entity;
struct TwitterTextParseResults;
struct ExtractResult;
struct MentionResult;
struct RustExtractor;
struct RustValidatingExtractor;
struct RustHitHighlighter;
struct RustValidator;
}
namespace twitter_text {
#ifndef CXXBRIDGE1_STRUCT_twitter_text$Range
#define CXXBRIDGE1_STRUCT_twitter_text$Range
struct Range final {
::std::int32_t start;
::std::int32_t end;
using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_twitter_text$Range
#ifndef CXXBRIDGE1_STRUCT_twitter_text$WeightedRange
#define CXXBRIDGE1_STRUCT_twitter_text$WeightedRange
struct WeightedRange final {
::twitter_text::Range range;
::std::int32_t weight;
using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_twitter_text$WeightedRange
#ifndef CXXBRIDGE1_STRUCT_twitter_text$Configuration
#define CXXBRIDGE1_STRUCT_twitter_text$Configuration
struct Configuration final {
::std::int32_t version;
::std::int32_t max_weighted_tweet_length;
::std::int32_t scale;
::std::int32_t default_weight;
::std::int32_t transformed_url_length;
::rust::Vec<::twitter_text::WeightedRange> ranges;
bool emoji_parsing_enabled;
using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_twitter_text$Configuration
#ifndef CXXBRIDGE1_STRUCT_twitter_text$AutolinkerConfig
#define CXXBRIDGE1_STRUCT_twitter_text$AutolinkerConfig
struct AutolinkerConfig final {
bool no_follow;
::rust::String url_class;
::rust::String url_target;
::rust::String symbol_tag;
::rust::String text_with_symbol_tag;
::rust::String list_class;
::rust::String username_class;
::rust::String hashtag_class;
::rust::String cashtag_class;
::rust::String username_url_base;
::rust::String list_url_base;
::rust::String hashtag_url_base;
::rust::String cashtag_url_base;
::rust::String invisible_tag_attrs;
bool username_include_symbol;
using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_twitter_text$AutolinkerConfig
#ifndef CXXBRIDGE1_STRUCT_twitter_text$Hit
#define CXXBRIDGE1_STRUCT_twitter_text$Hit
struct Hit final {
::std::size_t start;
::std::size_t end;
using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_twitter_text$Hit
#ifndef CXXBRIDGE1_STRUCT_twitter_text$Entity
#define CXXBRIDGE1_STRUCT_twitter_text$Entity
struct Entity final {
::std::int32_t entity_type;
::std::int32_t start;
::std::int32_t end;
::rust::String value;
::rust::String list_slug;
::rust::String display_url;
::rust::String expanded_url;
using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_twitter_text$Entity
#ifndef CXXBRIDGE1_STRUCT_twitter_text$TwitterTextParseResults
#define CXXBRIDGE1_STRUCT_twitter_text$TwitterTextParseResults
struct TwitterTextParseResults final {
::std::int32_t weighted_length;
::std::int32_t permillage;
bool is_valid;
::twitter_text::Range display_text_range;
::twitter_text::Range valid_text_range;
using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_twitter_text$TwitterTextParseResults
#ifndef CXXBRIDGE1_STRUCT_twitter_text$ExtractResult
#define CXXBRIDGE1_STRUCT_twitter_text$ExtractResult
struct ExtractResult final {
::twitter_text::TwitterTextParseResults parse_results;
::rust::Vec<::twitter_text::Entity> entities;
using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_twitter_text$ExtractResult
#ifndef CXXBRIDGE1_STRUCT_twitter_text$MentionResult
#define CXXBRIDGE1_STRUCT_twitter_text$MentionResult
struct MentionResult final {
::twitter_text::TwitterTextParseResults parse_results;
::std::unique_ptr<::twitter_text::Entity> mention;
using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_twitter_text$MentionResult
::std::unique_ptr<::twitter_text::Configuration> config_v1() noexcept;
::std::unique_ptr<::twitter_text::Configuration> config_v2() noexcept;
::std::unique_ptr<::twitter_text::Configuration> config_v3() noexcept;
::std::unique_ptr<::twitter_text::Configuration> default_config() noexcept;
::rust::Vec<::twitter_text::WeightedRange> get_config_weighted_ranges(const ::twitter_text::Configuration &config) noexcept;
::std::unique_ptr<::twitter_text::Configuration> configuration_from_path(::rust::Str path) noexcept;
::std::unique_ptr<::twitter_text::Configuration> configuration_from_json(::rust::Str json) noexcept;
::std::unique_ptr<::twitter_text::AutolinkerConfig> autolink_default_config() noexcept;
::rust::String autolink_all(::rust::Str text, const ::twitter_text::AutolinkerConfig &config) noexcept;
::rust::String autolink_usernames_and_lists(::rust::Str text, const ::twitter_text::AutolinkerConfig &config) noexcept;
::rust::String autolink_hashtags(::rust::Str text, const ::twitter_text::AutolinkerConfig &config) noexcept;
::rust::String autolink_urls(::rust::Str text, const ::twitter_text::AutolinkerConfig &config) noexcept;
::rust::String autolink_cashtags(::rust::Str text, const ::twitter_text::AutolinkerConfig &config) noexcept;
::rust::Box<::twitter_text::RustExtractor> make_extractor() noexcept;
bool get_extract_url_without_protocol(const ::twitter_text::RustExtractor &r) noexcept;
void set_extract_url_without_protocol(::twitter_text::RustExtractor &r, bool extract_url_without_protocol) noexcept;
::rust::Vec<::twitter_text::Entity> extract_entities_with_indices(const ::twitter_text::RustExtractor &r, ::rust::Str text) noexcept;
::rust::Vec<::rust::String> extract_mentioned_screennames(const ::twitter_text::RustExtractor &r, ::rust::Str text) noexcept;
::rust::Vec<::twitter_text::Entity> extract_mentioned_screennames_with_indices(const ::twitter_text::RustExtractor &r, ::rust::Str text) noexcept;
::rust::Vec<::twitter_text::Entity> extract_mentions_or_lists_with_indices(const ::twitter_text::RustExtractor &r, ::rust::Str text) noexcept;
::std::unique_ptr<::twitter_text::Entity> extract_reply_username(const ::twitter_text::RustExtractor &r, ::rust::Str text) noexcept;
::rust::Vec<::rust::String> extract_urls(const ::twitter_text::RustExtractor &r, ::rust::Str text) noexcept;
::rust::Vec<::twitter_text::Entity> extract_urls_with_indices(const ::twitter_text::RustExtractor &r, ::rust::Str text) noexcept;
::rust::Vec<::rust::String> extract_hashtags(const ::twitter_text::RustExtractor &r, ::rust::Str text) noexcept;
::rust::Vec<::twitter_text::Entity> extract_hashtags_with_indices(const ::twitter_text::RustExtractor &r, ::rust::Str text) noexcept;
::rust::Vec<::rust::String> extract_cashtags(const ::twitter_text::RustExtractor &r, ::rust::Str text) noexcept;
::rust::Vec<::twitter_text::Entity> extract_cashtags_with_indices(const ::twitter_text::RustExtractor &r, ::rust::Str text) noexcept;
::rust::Box<::twitter_text::RustValidatingExtractor> make_validating_extractor(const ::twitter_text::Configuration &config) noexcept;
bool get_extract_url_without_protocol_validated(const ::twitter_text::RustValidatingExtractor &e) noexcept;
void set_extract_url_without_protocol_validated(::twitter_text::RustValidatingExtractor &e, bool extract_url_without_protocol) noexcept;
bool get_normalize(const ::twitter_text::RustValidatingExtractor &e) noexcept;
void set_normalize(::twitter_text::RustValidatingExtractor &e, bool normalize) noexcept;
::std::unique_ptr<::twitter_text::ExtractResult> extract_entities_with_indices_validated(const ::twitter_text::RustValidatingExtractor &e, ::rust::Str text) noexcept;
::std::unique_ptr<::twitter_text::ExtractResult> extract_mentioned_screennames_with_indices_validated(const ::twitter_text::RustValidatingExtractor &e, ::rust::Str text) noexcept;
::std::unique_ptr<::twitter_text::ExtractResult> extract_mentions_or_lists_with_indices_validated(const ::twitter_text::RustValidatingExtractor &e, ::rust::Str text) noexcept;
::std::unique_ptr<::twitter_text::MentionResult> extract_reply_username_validated(const ::twitter_text::RustValidatingExtractor &e, ::rust::Str text) noexcept;
::std::unique_ptr<::twitter_text::ExtractResult> extract_urls_with_indices_validated(const ::twitter_text::RustValidatingExtractor &e, ::rust::Str text) noexcept;
::std::unique_ptr<::twitter_text::ExtractResult> extract_hashtags_with_indices_validated(const ::twitter_text::RustValidatingExtractor &e, ::rust::Str text) noexcept;
::std::unique_ptr<::twitter_text::ExtractResult> extract_cashtags_with_indices_validated(const ::twitter_text::RustValidatingExtractor &e, ::rust::Str text) noexcept;
::rust::Box<::twitter_text::RustHitHighlighter> make_highlighter(::rust::Str highlight_tag) noexcept;
::rust::Box<::twitter_text::RustHitHighlighter> make_default_highlighter() noexcept;
::rust::String hit_highlight(const ::twitter_text::RustHitHighlighter &hh, ::rust::Str text, const ::std::vector<::twitter_text::Hit> &hits) noexcept;
::rust::Box<::twitter_text::RustValidator> make_default_validator() noexcept;
bool is_valid_tweet(const ::twitter_text::RustValidator &validator, ::rust::Str s) noexcept;
bool is_valid_username(const ::twitter_text::RustValidator &validator, ::rust::Str s) noexcept;
bool is_valid_list(const ::twitter_text::RustValidator &validator, ::rust::Str s) noexcept;
bool is_valid_hashtag(const ::twitter_text::RustValidator &validator, ::rust::Str s) noexcept;
bool is_valid_url(const ::twitter_text::RustValidator &validator, ::rust::Str s) noexcept;
bool is_valid_url_without_protocol(const ::twitter_text::RustValidator &validator, ::rust::Str s) noexcept;
::std::int32_t get_max_tweet_length() noexcept;
::std::int32_t get_short_url_length(const ::twitter_text::RustValidator &validator) noexcept;
void set_short_url_length(::twitter_text::RustValidator &validator, ::std::int32_t short_url_length) noexcept;
::std::int32_t get_short_url_length_https(const ::twitter_text::RustValidator &validator) noexcept;
void set_short_url_length_https(::twitter_text::RustValidator &validator, ::std::int32_t short_url_length_https) noexcept;
::twitter_text::TwitterTextParseResults parse_ffi(::rust::Str text, const ::twitter_text::Configuration &config, bool extract_urls) noexcept;
} // namespace twitter_text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment