package farfadet
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Farfadet
Farfadet module.
type 'a t = Faraday.t -> 'a -> unitA writer. It's a function which takes the Faraday's encoder, a value 'a and write the value in the encoder.
val beint16 : int tWriter of a 16-bits integer in big-endian order.
val beint32 : int32 tWriter of a 16-bits integer in big-endian order.
Writer of a 32-bits integer in big-endian order.
val beint64 : int64 tWriter of a 32-bits integer in big-endian order.
Writer of a 64-bits integer in big-endian order.
val leint16 : int tWriter of a 64-bits integer in big-endian order.
Writer of a 16-bits integer in little-endian order.
val leint32 : int32 tWriter of a 16-bits integer in little-endian order.
Writer of a 32-bits integer in little-endian order.
val leint64 : int64 tWriter of a 32-bits integer in little-endian order.
Writer of a 64-bits integer in little-endian order.
val string : string tWriter of a string.
val bigstring : Faraday.bigstring tWriter of a Bytes.t.
Writer of a Faraday.bigstring.
val bool : bool tWriter of a bool. If the value is true, the writer writes '1', otherwise, it writes '0'.
val char : char tWriter of a bool. If the value is true, the writer writes '1', otherwise, it writes '0'.
Writer of a char.
seq a b composes 2 writers to one. It writes a, then b.
option a makes a new writer and expects an option value. If the valus is None, nothing happens. Otherwise, we call the writer a.
option a makes a new writer and expects an option value. If the valus is None, nothing happens. Otherwise, we call the writer a.
list ~sep a makes a new writer and expects a list of value (which have the type a). list ~sep a writes each value with the writer a interspersed by the writer sep.
comap a f makes a writer which runs f with the value and pass its results to a.
Operations on slices
type 'a sub = Faraday.t -> ?off:int -> ?len:int -> 'a -> unitA sub-writer with optional arguments off and len to specify which slice need to be written.
val substring : string subWriter of a sub-string.
val subbytes : bytes subWriter of a sub-string.
Writer of a sub-Bytes.t.
val subbigstring : Faraday.bigstring subWriter of a sub-Bytes.t.
Writer of a sub-Faraday.bigstring.
val blitter :
('a -> int) ->
('a -> src_off:int -> Faraday.bigstring -> dst_off:int -> len:int -> unit) ->
'a subWriter of a sub-Faraday.bigstring.
blitter len blit makes a new sub-writer which uses the specific blit function to blit the value to the internal Faraday.bigstring and the specific length function to get the length of the value 'a (used when the optional argument len = None).
eg. If you want to use a memcpy implementation instead a standalone memmove implementation.
A record which contains the optional values off and len.
Formatters
atom writer makes a new order to apply the writer to the Faraday's encoder.
val yield : ('v, 'v) orderconcat fmt1 fmt2 concats fmt1 with fmt2.
yield orders a Faraday.yield operations to the Faraday's encoder.
val flush : (unit -> unit) -> ('v, 'v) orderyield orders a Faraday.yield operations to the Faraday's encoder.
flush f registers f to be called when all prior writes have been successfully completed to the Faraday's encoder.
Constants
const kind value calls the writer kind with the value value directly.
const kind value calls the writer kind with the value value directly.
Infix operator of const.
Conveniences operations
module Const : sig ... endmodule Sched : sig ... end