|
microfmt
Zero-allocation C++ formatting for constrained environments
|
A sink adapter that writes formatted output directly into a boost::asio::mutable_buffer.
More...
#include <asio_sink.hpp>
Public Member Functions | |
| asio_mutable_buffer_sink (boost::asio::mutable_buffer buf RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS) noexcept | |
| Constructs a sink over a Boost.Asio mutable buffer. | |
| asio_mutable_buffer_sink (const asio_mutable_buffer_sink &)=delete | |
| asio_mutable_buffer_sink & | operator= (const asio_mutable_buffer_sink &)=delete |
| asio_mutable_buffer_sink (asio_mutable_buffer_sink &&) noexcept=default | |
| asio_mutable_buffer_sink & | operator= (asio_mutable_buffer_sink &&) noexcept=default |
| sink | as_sink () noexcept RELOCO_LIFETIMEBOUND |
| Creates a type-erased sink adapter pointing to this instance. | |
| size_t | size () const noexcept |
| Returns the total number of bytes written to the buffer so far. | |
| boost::asio::const_buffer | written_buffer () const noexcept RELOCO_LIFETIMEBOUND |
Returns the written prefix of the wrapped buffer as a boost::asio::const_buffer, suitable for boost::asio::write / boost::asio::async_write. | |
A sink adapter that writes formatted output directly into a boost::asio::mutable_buffer.
Wraps an externally provided buffer view (e.g. a coroutine's stack buffer) and exposes a non-owning, zero-allocation sink interface, mirroring span_sink. Tracks remaining capacity and truncates writes that exceed it instead of overflowing.
|
inlineexplicitnoexcept |
Constructs a sink over a Boost.Asio mutable buffer.
| buf | Target mutable buffer. The memory it refers to must outlive this sink, and (via written_buffer) any pending async write that consumes its result. |
|
delete |
|
defaultnoexcept |
|
inlinenoexcept |
Creates a type-erased sink adapter pointing to this instance.
|
defaultnoexcept |
|
delete |
|
inlinenoexcept |
Returns the total number of bytes written to the buffer so far.
|
inlinenoexcept |
Returns the written prefix of the wrapped buffer as a boost::asio::const_buffer, suitable for boost::asio::write / boost::asio::async_write.
The returned buffer aliases this sink's backing storage and must not outlive it.