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>> :
public fmt::formatter<std::string_view> {
31 template <
typename FormatContext>
32 auto format(
const USERVER_NAMESPACE::utils::SmallString<N>& value, FormatContext& ctx)
const
33 ->
decltype(ctx.out()) {
34 return formatter<std::string_view>::format(std::string_view{value}, ctx);