mirage/ocaml-cstruct — pull request #28 by djs55 (2014-07-04 21:29:40+00:00)
Title: Add Lwt_cstruct.complete convenience function

When dealing with functions like 'read' and 'write' which return
an integer which means:
0: End_of_file
n: n bytes written
we can now write 'complete read' which will keep executing 'read'
until the whole buffer has been processed, returning () or
failing with End_of_file.

Signed-off-by: David Scott

This is a common pattern which I've ended up reimplementing all over the place.