Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file types.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596(** Module for abstracting async and lwt *)moduletypeIo=sigmoduleDeferred:sigtype'atmoduleOr_error:sigtypenonrec'at=('a,exn)resulttvalreturn:'a->'atvalfail:exn->'atvalcatch:(unit->'at)->'atval(>>=):'at->('a->'bt)->'btendvalreturn:'a->'atvalafter:float->unittvalcatch:(unit->'at)->'aOr_error.tvalasync:unitt->unitval(>>=):'at->('a->'bt)->'btval(>>|):'at->('a->'b)->'btval(>>=?):('a,'c)resultt->('a->('b,'c)resultt)->('b,'c)resulttend(**/**)moduleIvar:sigtype'atvalcreate:unit->'atvalfill:'at->'a->unitvalwait:'at->'aDeferred.tend(**/**)(** Module mimicking Async.Pipe *)modulePipe:sig(** Generic pipe *)type('a,'b)pipe(**/**)typewriter_phantomtypereader_phantom(**/**)type'awriter=('a,writer_phantom)pipetype'areader=('a,reader_phantom)pipe(** Create a reader given a function f that fills the reader. Once f completes, the reader is closed *)valcreate_reader:f:('awriter->unitDeferred.t)->'areader(** Create a writer given a function f that reads off the writer. Once f completes, the writer is closed *)valcreate_writer:f:('areader->unitDeferred.t)->'awriter(** Create a reader/writer pipe. Data written to the reader can be read by the writer.
Closing one end will close both ends. *)valcreate:unit->'areader*'awriter(** Flush a writer. The result we be determined once all elements in the pipe has been consumed *)valflush:'awriter->unitDeferred.t(** Write to a writer. If the writer is closed, the function raises an exception *)valwrite:'awriter->'a->unitDeferred.t(** Close a writer *)valclose:'awriter->unit(** Close a reader *)valclose_reader:'areader->unit(** Read one element from a reader. The function will block until an element becomes available or the
reader is closed, in which case [None] is returned *)valread:'areader->'aoptionDeferred.t(** Transfer all data from the reader to the writer. The function becomes determined when the reader or writer is closed *)valtransfer:'areader->'awriter->unitDeferred.t(** Return the state of a pipe *)valis_closed:('a,'b)pipe->bool(** Wait for a pipe to be closed. The function is determined once the pipe is closed.
the function can be called multiple times.
Note that not all elements may have been consumed yet.
*)valclosed:('a,'b)pipe->unitDeferred.tend(**/**)moduleNet:sigvalconnect:inet:[`V4|`V6]->host:string->port:int->scheme:[<`Http|`Https]->(stringPipe.reader*stringPipe.writer)Deferred.Or_error.tend(**/**)end