Version 1.3.0
This is a preliminary version of the documentation. Help us to improve it by filling tickets. We are looking for native english speakers to proof read the documentation. Contact us!
module Ocsigen_stream:Streams are a means to read data block by blocksig..end
exception Interrupted of exnexception Cancelled
exception Already_read
exception Finalized
type 'a stream type 'a step = private | | Finished of |
| | Cont of |
type 'a t val make : ?finalize:(unit -> unit Lwt.t) ->
(unit -> 'a step Lwt.t) -> 'a tval get : 'a t -> 'a streamAlready_read if the stream has already been read.val next : 'a stream -> 'a step Lwt.tInterrupted e if reading the thread failed with exception e, and with Cancelled if the thread has been cancelled.val empty : (unit -> 'a step Lwt.t) option -> 'a step Lwt.tval cont : 'a -> (unit -> 'a step Lwt.t) -> 'a step Lwt.tval add_finalizer : 'a t -> (unit -> unit Lwt.t) -> unitval finalize : 'a t -> unit Lwt.tval cancel : 'a t -> unit Lwt.tOcsigen_stream.Cancelledval consume : 'a t -> unit Lwt.texception Stream_too_small
exception Stream_error of stringexception String_too_large
val string_of_stream : string stream -> string Lwt.tval enlarge_stream : string step -> string step Lwt.tval stream_want : string step -> int -> string step Lwt.tstream_want s len Returns a stream with at least len bytes in the buffer if possibleval current_buffer : string step -> stringval skip : string step -> int64 -> string step Lwt.tStream_too_small (Some size) if the stream is too small, where size is the size of the stream.val substream : string -> string step -> string step Lwt.tval of_file : string -> string tval of_string : string -> string t