package capnp
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=d3060f4b6bebb69d74608519da20dab1d59c88557ebcfce8c66a8f3f7f5f6035
sha512=43d6f06d99b4c54e8784ab3de83e1f538ff732831b4014ba983fd932e4ecbd5460837374bcf454961e4ee6de374b5169a89a417463f109dc00346d6980d2e038
doc/capnp.unix/Capnp_unix/IO/ReadContext/index.html
Module IO.ReadContext
Source
val create :
read:('a -> buf:Bytes.t -> pos:int -> len:int -> int) ->
compression:Capnp.Codecs.compression_t ->
'a ->
'a t
create ~read ~compression descr
creates a new context for reading data from the specified descriptor using the specified compression
method.
The semantics of the read
function shall mimic that of Unix.read
, attempting to read into a substring of the buf
and returning the number of bytes actually read. A read of length 0 indicates end-of-file.
dequeue_message context
attempts to remove a complete message from the incoming queue of the read context
. No data will be read from the underlying descriptor.
bytes_available context
obtains the number of bytes already read which are currently stored in the read context
.
read context
attempts to read some data from the underlying descriptor, storing it in the read context
.
read_message context
attempts to remove a complete message from the incoming queue of the read context
. read
may be invoked repeatedly to provide enough buffered data to decode a complete message.