Module Reader_stream.Make
Parameters
Signature
type json_stream= Parser.Compliance.json_streamtype stream
json_stream_* and decode functions
val json_stream_of_string : string -> streamjson_stream_of_string screates a stream parser that returns a series ofjson_streamelements from the strings.
val json_stream_of_channel : Stdlib.in_channel -> streamjson_stream_of_channel iccreates a stream parser that returns a series ofjson_streamelements from thein_channelic.
val json_stream_of_function : (bytes -> int -> int) -> streamjson_stream_of_function fcreates a stream parser that returns a series ofjson_streamelements from the reader functionf.f buf lentakes a bufferbufand maximum lengthlenand returns the number of bytes read to a maximum oflen
val decode_stream : stream -> (json_stream option, string) Stdlib.resultdecode_stream tdecode the next element of the input,Ok Noneindicates end of the stream
Stream.t functions
These functions provide a Stream.t API on top of the json_stream_of_* and decode_stream functions.
val stream_from_string : string -> json_stream Stdlib.Stream.tstream_from_string screates ajson_stream Stream.tfromjson_stream_of_string sanddecode_stream
val stream_from_channel : Stdlib.in_channel -> json_stream Stdlib.Stream.tstream_from_channel iccreates ajson_stream Stream.tfromjson_stream_of_channel icanddecode_stream
val stream_from_function : (bytes -> int -> int) -> json_stream Stdlib.Stream.tstream_from_function fcreates ajson_stream Stream.tfromjson_stream_of_function fanddecode_stream