12#include <userver/formats/bson/document.hpp>
13#include <userver/formats/bson/iterator.hpp>
14#include <userver/formats/bson/types.hpp>
15#include <userver/formats/bson/value.hpp>
16#include <userver/formats/common/meta.hpp>
17#include <userver/formats/common/transfer_tag.hpp>
18#include <userver/formats/common/type.hpp>
19#include <userver/utils/strong_typedef.hpp>
21USERVER_NAMESPACE_BEGIN
57 explicit ValueBuilder(impl::ValueImplPtr);
72 ValueBuilder(
Value&&);
79 ValueBuilder(std::nullptr_t);
82 ValueBuilder(
unsigned int);
84 ValueBuilder(
unsigned long);
85 ValueBuilder(
long long);
86 ValueBuilder(
unsigned long long);
88 ValueBuilder(
const char*);
90 ValueBuilder(std::string);
91 ValueBuilder(std::string_view);
92 ValueBuilder(
const std::chrono::system_clock::time_point&);
93 ValueBuilder(
const Oid&);
102 template <
typename T>
122 utils::StrongTypedefOps Ops,
200 void Assign(
const impl::ValueImplPtr&);
201 void Assign(impl::ValueImplPtr&&);
203 template <
typename T>
204 static Value DoSerialize(
const T& t);
206 impl::ValueImplPtr impl_;
209template <
typename Tag, utils::StrongTypedefOps Ops,
typename Enable>
211 return (*
this)[name.GetUnderlying()];
218 "There is no `Serialize(const T&, formats::serialize::To<bson::Value>)` "
219 "in namespace of `T` or `formats::serialize`. "
221 "Probably you forgot to include the "
222 "<userver/formats/serialize/common_containers.hpp> or you "
223 "have not provided a `Serialize` function overload."
226 return Serialize(t, formats::serialize::To<Value>());