Awskit_s3_lwt_unix.Readerinclude Awskit_s3.READER
with type 'a io := 'a Lwt.t
and type t = Runtime.response_body_readertype t = Runtime.response_body_readerScoped response body reader.
Readers passed to object consume callbacks are valid only until the callback returns. Drain, copy, or decode the body inside that callback.
val read :
t ->
bytes ->
off:int ->
len:int ->
(int, Awskit.Error.t) Stdlib.result Lwt.tRead up to len bytes into bytes starting at off.
Returns Ok 0 at end of body.
val next :
?chunk_size:int ->
t ->
(bytes option, Awskit.Error.t) Stdlib.result Lwt.tRead the next fresh chunk, or None at end of body.
chunk_size must be positive when supplied.
val fold :
?chunk_size:int ->
t ->
init:'a ->
f:('a -> bytes -> ('a, Awskit.Error.t) Stdlib.result Lwt.t) ->
('a, Awskit.Error.t) Stdlib.result Lwt.tFold over response-body chunks until end of body or the callback returns an error.
val iter :
?chunk_size:int ->
t ->
f:(bytes -> (unit, Awskit.Error.t) Stdlib.result Lwt.t) ->
(unit, Awskit.Error.t) Stdlib.result Lwt.tIterate over response-body chunks until end of body or the callback returns an error.
val to_bytes :
?chunk_size:int ->
max_bytes:int64 ->
t ->
(bytes, Awskit.Error.t) Stdlib.result Lwt.tDrain the body into memory as bytes, failing if it exceeds max_bytes.
val to_string :
?chunk_size:int ->
max_bytes:int64 ->
t ->
(string, Awskit.Error.t) Stdlib.result Lwt.tDrain the body into a string, failing if it exceeds max_bytes.
val to_channel :
?on_progress:(int64 -> unit) ->
Lwt_io.output_channel ->
t ->
(unit, Awskit_s3.Error.t) Stdlib.result Lwt.tStream a response body into an existing output channel. The caller owns and closes the channel.
val to_path :
?on_progress:(int64 -> unit) ->
string ->
t ->
(unit, Awskit_s3.Error.t) Stdlib.result Lwt.tStream a response body into a private 0o600 temporary file, then publish it at the target path when the copy succeeds.