package capnp

  1. Overview
  2. Docs
OCaml code generation plugin for the Cap'n Proto serialization framework

Install

Dune Dependency

Authors

Maintainers

Sources

capnp-3.5.0.tbz
sha256=d3060f4b6bebb69d74608519da20dab1d59c88557ebcfce8c66a8f3f7f5f6035
sha512=43d6f06d99b4c54e8784ab3de83e1f538ff732831b4014ba983fd932e4ecbd5460837374bcf454961e4ee6de374b5169a89a417463f109dc00346d6980d2e038

doc/capnp.unix/Capnp_unix/IO/WriteContext/index.html

Module IO.WriteContextSource

Sourcetype 'a t
Sourceval create : write:('a -> buf:string -> pos:int -> len:int -> int) -> compression:Capnp.Codecs.compression_t -> 'a -> 'a t

create ~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.

Sourceval enqueue_message : 'a t -> 'cap Capnp.Message.BytesMessage.Message.t -> unit

enqueue_message context message places the message in the outgoing queue of the write context. No data will be written to the underlying descriptor.

Sourceval bytes_remaining : 'a t -> int

bytes_remaining context obtains the number of unwritten bytes currently stored in the write context.

Sourceval write : 'a t -> int

write context attempts to write some of the queued data to the underlying descriptor associated with the write context.

  • returns

    the number of bytes actually written

Sourceval write_message : 'a t -> 'cap Capnp.Message.BytesMessage.Message.t -> unit

write_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.

OCaml

Innovation. Community. Security.