boost::capy::any_write_sink::write_eof

Atomically write data and signal end‐of‐stream.

Synopsis

template<ConstBufferSequence CB>
io_task<std::size_t>
write_eof(CB buffers);

Description

Writes all data from the buffer sequence and then signals end‐of‐stream. The implementation decides how to partition the data across calls to the underlying sink's write and write_eof. When the caller's buffer sequence is non‐empty, the final call to the underlying sink is always write_eof with a non‐empty buffer sequence. When the caller's buffer sequence is empty, only write_eof() with no data is called.

Immediate Completion

The operation completes immediately without suspending the calling coroutine when:

  • The buffer sequence is empty. Only the write_eof() call is performed.

  • All underlying operations complete immediately (the wrapped sink reports readiness via `await_ready`).

Preconditions

The wrapper must contain a valid sink (has_value() == true).

Return Value

An awaitable yielding (error_code,std::size_t).

Parameters

Name Description

buffers

The buffer sequence containing data to write.

Created with MrDocs