package ez_api
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=e1d03d141ef977fbd4521256c91431f1
sha512=51b0cc4e6afb0cd5ab55c0c40964946b79e0c2cc903b5d08c594292eec723a25e25463175d704c02fe559e2af5d95973514c248a603ad28ec0230c35ad2d6492
doc/ez_api.cohttp_base/EzCohttp_base/Make/argument-1-Client/IO/index.html
Module Client.IO
include Cohttp.S.IO with type 'a t = 'a Lwt.t with type 'a t = 'a Lwt.t
type 'a t = 'a Lwt.t'a t represents a blocking monad state
a >>= b will pass the result of a to the b function. This is a monadic bind.
val return : 'a -> 'a treturn a will construct a constant IO value.
val with_input_buffer :
ic ->
f:(string -> pos:int -> len:int -> 'a * int) ->
'aread_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.
read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.
write oc s will block until the complete s string is written to the output channel oc.
catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.
val pp_error : Format.formatter -> error -> unit