let make ?(buffer:[`clear of int | `reset of int]= `reset 1024) ~to_string () =
let buffer, clear_buffer =
match buffer with
| `clear s -> (Buffer.create s, Buffer.clear)
| `reset s -> (Buffer.create s, Buffer.reset) in
{
records = Queue.create ();
buffer; clear_buffer;
to_string;
}