package eio

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

Install

Dune Dependency

Authors

Maintainers

Sources

eio-1.0.tbz
sha256=da260d9da38b3dde9f316652a20b13a261cf90b85a2498ac669b7d564e61942d
sha512=5886e1159f48ede237769baa1d8b5daafa0310e4192d7fe0e8c32aef70f2b6378cef72d0fbae308457e25d87a69802b9ee83a5e8f23e0591d83086a92d701c46

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.