package shuttle

  1. Overview
  2. Docs

Module Shuttle.Input_channelSource

Sourcetype t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourcetype slice = private {
  1. buf : Core.Bigstring.t;
  2. pos : int;
  3. len : int;
}
Sourceval create : ?buf_len:int -> ?time_source:[> Core.read ] Async_kernel.Time_source.T1.t -> Async_unix.Fd.t -> t
Sourceval time_source : t -> Async_kernel.Time_source.t
Sourceval buffer_size : t -> int
Sourceval is_closed : t -> bool
Sourceval closed : t -> unit Async_kernel.Deferred.t
Sourceval close : t -> unit Async_kernel.Deferred.t
Sourceval refill : t -> [> `Ok | `Eof ] Async_kernel.Deferred.t
Sourceexception Timeout
Sourceval refill_with_timeout : t -> Core.Time_ns.Span.t -> [> `Ok | `Eof ] Async_kernel.Deferred.t
Sourceval view : t -> slice
Sourceval consume : t -> int -> unit
Sourceval drain : t -> unit Async_kernel.Deferred.t

drain t reads chunks of data from the reader and discards them.

Sourceval pipe : t -> string Async_kernel.Pipe.Reader.t

pipe returns a reader pipe that contains the results of reading chunks from an input_channel.

Sourceval transfer : t -> string Async_kernel.Pipe.Writer.t -> unit Async_kernel.Deferred.t

transfer will read chunks from an input channel and write them to the provided writer end of an async pipe. The deferred returned by the function will be determined on EOF or if the writer is closed. Use transfer in scenarios where pipe is needed, but if there is a need to not close the channel automatically once the transfer is finished.

Sourceval of_pipe : ?buf_len:int -> Core.Info.t -> string Async_kernel.Pipe.Reader.t -> t Async_kernel.Deferred.t
OCaml

Innovation. Community. Security.