package eio

  1. Overview
  2. Docs
Effect-based direct-style IO API for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

eio-0.14.tbz
sha256=52f85b947d3e0de70940b5bbaac0d3e78841fea5648e73af7d8a754ab51c871b
sha512=944095b1131d2dcc1f0d415fe46fd78b883733e0f95985e3a0feafe73b1703606ec60560abf36c16c364cc60164b7330f236e39569e264c702bb5647e28bfd3c

doc/eio.mock/Eio_mock/Flow/index.html

Module Eio_mock.FlowSource

Mock Eio.Flow sources and sinks.

Sourcetype copy_method = [
  1. | `Read_into
    (*

    Use the source's read_into method (the default).

    *)
  2. | `Read_source_buffer
    (*

    Use the Eio.Flow.Read_source_buffer optimisation.

    *)
]
Sourcetype ty = [ `Generic | `Mock ] Eio.Net.stream_socket_ty
Sourceval make : ?pp:string Fmt.t -> string -> t

make label is a mock Eio flow. It can be used as a source, sink, or two-way flow.

  • parameter pp

    Printer to use to display the data.

Sourceval on_read : t -> string Handler.actions -> unit

on_read t actions configures the values to return from the mock's read function.

Sourceval on_copy_bytes : t -> int Handler.actions -> unit

on_copy_bytes t actions configures the number of bytes to copy in each iteration.

Sourceval set_copy_method : t -> copy_method -> unit

set_copy_method t m configures t to use the given method to read from a source during a copy operation.

OCaml

Innovation. Community. Security.