7#include <userver/formats/parse/to.hpp>
8#include <userver/formats/serialize/to.hpp>
9#include <userver/utils/small_string.hpp>
11USERVER_NAMESPACE_BEGIN
15template <
typename Value, std::size_t N>
17 return typename Value::Builder{std::string_view{value}}.ExtractValue();
20template <
typename Value, std::size_t N>
22 return SmallString<N>{value.
template As<std::string>()};
29template <std::size_t N>
30struct fmt::formatter<USERVER_NAMESPACE::utils::SmallString<N>>
31 :
public fmt::formatter<std::string_view> {
32 template <
typename FormatContext>
33 auto format(
const USERVER_NAMESPACE::utils::SmallString<N>& value,
34 FormatContext& ctx)
const ->
decltype(ctx.out()) {
35 return formatter<std::string_view>::format(std::string_view{value}, ctx);