13#include "../microfmt.hpp"
14#include "../reloco.hpp"
16#include <boost/asio/awaitable.hpp>
17#include <boost/asio/use_awaitable.hpp>
18#include <boost/asio/write.hpp>
40template <
typename Stream, std::size_t StackSize = 256,
typename... Args>
41[[nodiscard]] boost::asio::awaitable<std::size_t>
async_format_to(Stream &stream, string_view
fmt, Args &&...args) {
43 char stack_buffer[StackSize];
53 co_return co_await boost::asio::async_write(stream,
sink.written_buffer(), boost::asio::use_awaitable);
Boost.Asio buffer and stream sink adapters for zero-allocation formatting.
A sink adapter that writes formatted output directly into a boost::asio::mutable_buffer.
Definition asio_sink.hpp:30
Definition asio_coroutine.hpp:22
boost::asio::awaitable< std::size_t > async_format_to(Stream &stream, string_view fmt, Args &&...args)
Formats a message directly into a stack buffer and asynchronously writes it to a Boost....
Definition asio_coroutine.hpp:41
reloco::sink sink
Type-erased, zero-allocation output sink.
Definition microfmt.hpp:46
RELOCO_CONSTEXPR20 void format_to(const sink &out, microfmt::string_view fmt, const Args &...args) noexcept
Definition microfmt.hpp:1766