package capnp
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=20221b396b17c654e5d0870761bef50c5a5dc99bc578e31980bac76dae1d3560
md5=1c8519640a3e5f06c48220d2194d9d36
doc/capnp.unix/Capnp_unix/IO/WriteContext/index.html
Module IO.WriteContext
val create :
write:('a -> buf:string -> pos:int -> len:int -> int) ->
compression:Capnp.Codecs.compression_t ->
'a ->
'a tcreate ~write ~compression descr creates a new context for writing data to the specified descriptor. compression specifies the compression format, if any.
The semantics of the write function shall mimic that of Unix.single_write, attempting to write a substring from the buf and returning the number of bytes actually written.
val enqueue_message : 'a t -> 'cap Capnp.Message.BytesMessage.Message.t -> unitenqueue_message context message places the message in the outgoing queue of the write context. No data will be written to the underlying descriptor.
val bytes_remaining : 'a t -> intbytes_remaining context obtains the number of unwritten bytes currently stored in the write context.
val write : 'a t -> intwrite context attempts to write some of the queued data to the underlying descriptor associated with the write context.
val write_message : 'a t -> 'cap Capnp.Message.BytesMessage.Message.t -> unitwrite_message context message places the message in the outgoing queue of the write context, then invokes write in a loop until all queued data has been written.