boost::capy::read

read overloads

Synopses

Declared in <boost/capy/read.hpp>

Asynchronously read until the buffer sequence is full.

io_task<std::size_t>
read(
    auto& stream,
    auto const& buffers);

Asynchronously read all data from a stream into a dynamic buffer.

io_task<std::size_t>
read(
    auto& stream,
    auto&& buffers,
    std::size_t initial_amount = 2048);

Return Value

  • An awaitable yielding (error_code, std::size_t). On success, n equals buffer_size(buffers). On error, n is the number of bytes read before the error. Compare error codes to conditions:

  • An awaitable yielding (error_code, std::size_t). On success (EOF), ec is clear and n is total bytes read. On error, n is bytes read before the error. Compare error codes to conditions:

Parameters

Name Description

stream

The stream to read from. The caller retains ownership.

buffers

The buffer sequence to fill. The caller retains ownership and must ensure validity until the operation completes.

initial_amount

Initial bytes to prepare (default 2048).

source

The source to read from. The caller retains ownership.

See Also

read_some, ReadStream, MutableBufferSequence

read_some, ReadStream, DynamicBufferParam

ReadSource, DynamicBufferParam

Created with MrDocs