Module type Signatures.Output

type _ t

We assume a type representing a stream of written object. No function to create such flux are included in this signature, but we expect each output module to come with its own way of generating flux. The type is parameterised by the expected output when closing the flux. It is possible to choose unit as a parameter in the case where the output is done with side-effects.

type error
exception Invalid_output of error
val error_to_string : error -> string

Print-out the error.

val write_node : _ t -> Repr.Node.t -> unit

Write a node.

val write_nodes : _ t -> Repr.Node.t Stdlib.Seq.t -> unit

Write multiple nodes.

val write_way : _ t -> Repr.Way.t -> unit

Write a way.

val write_ways : _ t -> Repr.Way.t Stdlib.Seq.t -> unit

Write multiple ways.

val write_relation : _ t -> Repr.Relation.t -> unit

Write a relation.

val write_relations : _ t -> Repr.Relation.t Stdlib.Seq.t -> unit

Write multiple relations.

val write_object : _ t -> Repr.Object.t -> unit

Write an object.

val write_objects : _ t -> Repr.Object.t Stdlib.Seq.t -> unit

Write multiple objects.

val close : 'a. 'a t -> 'a

Close an output, returning the final object.