Runtime.Response_bodyScoped response-body reader. It must not be used outside with_reader.
Read into bytes. Returns Ok 0 at end-of-body. Invalid bounds return Error Body. Native runtime cancellation remains native. After a read error, timeout, or cancellation, the reader is no longer valid.
Read the next chunk, or None at end-of-body. chunk_size must be positive.
val with_reader :
t ->
consume:(reader -> ('a, Error.t) Stdlib.result io) ->
('a, Error.t) Stdlib.result ioScope a response body reader to consume.
Callers must not retain the reader after consume returns. Runtime adapters must attempt to drain or discard the response body after consume. If consume returns Ok _, a drain failure is returned. If consume returns Error _, that error wins over cleanup failures. If consume raises or native cancellation occurs, cleanup is attempted and the original exception or cancellation is preserved.