package httpcats

  1. Overview
  2. Docs

Module Flow.Of_bytesSource

Parameters

module Flow : BYTES

Signature

include S
Sourcetype t
Sourceval read : t -> Bstr.t -> off:int -> len:int -> int

read flow bstr ~off ~len reads at most len bytes from flow into bstr at off and returns how many bytes were actually read. 0 means end-of-input.

Sourceval writev : t -> Bstr.t Faraday.iovec list -> unit

writev flow iovecs writes all the given iovecs to flow.

NOTE: the buffers of iovecs belong to the caller and are reused as soon as writev returns. An implementation which defers the actual transmission (such as utcp, which keeps the segment in its own state) must take a copy.

Sourceval close : t -> unit
Sourceval shutdown : t -> [ `read | `write | `read_write ] -> unit
Sourcetype flow = Flow.t
Sourceval make : ?chunk_size:int -> flow -> t
Sourceval prj : t -> flow