12#include <userver/compiler/select.hpp>
13#include <userver/formats/bson/document.hpp>
14#include <userver/formats/bson/value.hpp>
15#include <userver/formats/json_fwd.hpp>
16#include <userver/logging/log_helper_fwd.hpp>
17#include <userver/utils/fast_pimpl.hpp>
18#include <userver/utils/fmt_compat.hpp>
20USERVER_NAMESPACE_BEGIN
22namespace formats::
parse {
31namespace formats::
bson {
82 explicit JsonString(impl::JsonStringImpl&&);
87 operator std::string()
const {
return ToString(); }
95 const char* Data()
const;
102 static constexpr std::size_t kAlignment =
alignof(
void*);
103 utils::FastPimpl<impl::JsonStringImpl, kSize, kAlignment, utils::kStrictMatch>
107std::ostream& operator<<(std::ostream&,
const JsonString&);
119struct fmt::formatter<USERVER_NAMESPACE::formats::bson::JsonString>
120 :
public fmt::formatter<std::string_view> {
121 template <
typename FormatContext>
122 auto format(
const USERVER_NAMESPACE::formats::bson::JsonString& json,
124 return fmt::formatter<std::string_view>::format(json.GetView(), ctx);
130struct fmt::formatter<USERVER_NAMESPACE::formats::bson::Document>
131 :
public fmt::formatter<std::string_view> {
132 template <
typename FormatContext>
133 auto format(
const USERVER_NAMESPACE::formats::bson::Document& bson,
135 return fmt::formatter<std::string_view>::format(
136 USERVER_NAMESPACE::formats::bson::ToRelaxedJsonString(bson).GetView(),