package piaf
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=07fa9009a52faeaae6d86116e75007f5279b185c7bc7c95aab9455f2107370fb
sha512=dfde4bd0a5c8a3b795a8e3d6f6e1f9f1864a9eb0a1b96763c17515d771566af7623ca64db671a8dce2c7838dad08d8465db98f5e4f8dcf5e1a386ef5b29da56c
doc/piaf.multipart_form/Piaf_multipart_form/Header/Encoder/index.html
Module Header.Encoder
Source
include module type of struct include Prettym end
Abstract data corresponding to the encoder state and all its machinery.
break ~indent ~len
tries to add len
spaces into the current line. If it fails - if we overflow the current line - we insert a new_line
and fill the beginning of the new line with indent
space characters.
fws
is a specialization of break
with indent = 1
and spaces = 1
. This is the most used token to express an opportunity to break the line and be conform to RFC 822
and the folding-whitespace token.
cut
gives an opportunity to add a break line without indentation and spaces.
a
expects a serializer pp
and a value to serialize it then.
new_line
inserts a new line regardless how many bytes the current line has.
tbox indent
creates a new box to indent any contents inside with indent
spaces.
bbox
creates a new box to indent any contents at the current position of the serializer.
using f pp
apply f
on the value and use pp
then to serialize the result.
bigstring
permits to serialize a bigstring.
list ~sep pp
permits to serialize a list of values which can be serialized with pp
. Between each values, we apply sep
.
create ?margin ?new_line ~emitter weight
creates a serializer bounded to weight
elements. The serializer is limiter to emit margin
bytes per lines and break the line with new_line
(default to "\r\n"
).
emitter
is called when the serializer is full. It gives to user what it needs to transmit to the output and it asks how many bytes the user was able to transmit.
is_empty ppf
returns true
if the serializer is empty. Otherwise, it returns false
.
flush ppf
enforces the serializer to call the internal emitter
to transmit out what is serialized - even if ppf
is not full.
to_string ?margin ?new_line pp v
serializes a value v
with the serializer pp
into a string
.