85requires(!std::is_arithmetic_v<T> && !std::is_convertible_v<T&,
utils::impl::strong_typedef::StrongTypedefTag&>)
87 using Value =
typename StringBuilder::Value;
89 if constexpr (meta::kIsMap<T>) {
90 impl::WriteToStreamDict(value, sw);
91 }
else if constexpr (meta::kIsRange<T>) {
93 !std::is_same_v<T, boost::uuids::uuid>,
94 "Include <userver/formats/serialize/boost_uuid.hpp> to serialize 'boost::uuids::uuid"
97 !meta::IsRecursiveRange<T>,
98 "Trying to log a recursive range, which can be dangerous. "
99 "(boost::filesystem::path?) Please implement WriteToStream for your type"
101 impl::WriteToStreamArray(value, sw);
102 }
else if constexpr (
common::impl::HasSerialize<Value, T>) {
104 !
sizeof(T) || impl::kIsSerializeAllowedInWriteToStream<T, StringBuilder>,
105 "SAX serialization falls back to Serialize call, which is not "
106 "allowed. Please implement WriteToStream for your type"
108 sw.WriteValue(Serialize(value,
serialize::To<Value>{}));
110 static_assert(!
sizeof(T),
"Please implement WriteToStream or Serialize for your type");