Module Proto.Twstat

Twstat allows for changes to be made to file attributes. A file may be renamed in this way but its location cannot be changed.

The provided Stat structure can set "dont-touch" values for any field; a 0-length field for variable-length fields, and the maximum value for fixed integer fields. This indicates that the server should leave the existing values for those fields and only apply fields that do not have "dont-touch" values.

Another convention is that if the Stat structure contains only "dont-touch" values, it is a request to flush any buffered data to persistent storage.

type t
val size : t -> int

The size of this message in bytes. It is identical to the length of the underlying I/O vector but is also encoded in the first 4 bytes of the message.

val code : int

The op code for this message.

val tag : t -> Tag.t

An identifier for this transaction. All in-flight requests on a given connection must have unique tags.

val of_iovec : Iovec.t -> t

of_iovec verifies a message from an I/O vector. No copying is done, and of_iovec only performs bounds checks. Modifying the underlying I/O vector will change the results when accessing message fields.

val fid : t -> Fid.t
val stat : t -> Styx__.Types.Stat.t
val init : Iovec.t -> tag:Tag.t -> Iovec.writer

init iov ~tag writes a Twstat header to iov and returns an Iovec.writer positioned after the header, which can be used with Stat.write.