Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Prettym
SourceAbstract 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
.