ocaml-opentelemetry/eio/Eio_mock/Flow/index.html
2026-04-06 19:57:49 +00:00

2 lines
4.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Flow (eio.Eio_mock.Flow)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../../index.html">Index</a> &#x00BB; <a href="../../index.html">eio</a> &#x00BB; <a href="../index.html">Eio_mock</a> &#x00BB; Flow</nav><header class="odoc-preamble"><h1>Module <code><span>Eio_mock.Flow</span></code></h1><p>Mock <a href="../../Eio/Flow/index.html"><code>Eio.Flow</code></a> sources and sinks.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-copy_method"><a href="#type-copy_method" class="anchor"></a><code><span><span class="keyword">type</span> copy_method</span><span> = </span><span>[ </span></code><ol><li id="type-copy_method.Read_into" class="def variant constructor anchored"><a href="#type-copy_method.Read_into" class="anchor"></a><code><span>| </span><span>`Read_into</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Use the source's <code>read_into</code> method (the default).</p><span class="comment-delim">*)</span></div></li><li id="type-copy_method.Read_source_buffer" class="def variant constructor anchored"><a href="#type-copy_method.Read_source_buffer" class="anchor"></a><code><span>| </span><span>`Read_source_buffer</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Use the <a href="../../Eio/Flow/index.html#extension-Read_source_buffer"><code>Eio.Flow.Read_source_buffer</code></a> optimisation.</p><span class="comment-delim">*)</span></div></li></ol><code><span> ]</span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-ty"><a href="#type-ty" class="anchor"></a><code><span><span class="keyword">type</span> ty</span><span> = <span><span>[ `Generic <span>| `Mock</span> ]</span> <a href="../../Eio/Net/index.html#type-stream_socket_ty">Eio.Net.stream_socket_ty</a></span></span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = <span><a href="#type-ty">ty</a> <a href="../../Eio/Std/index.html#type-r">Eio.Std.r</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make : <span><span class="optlabel">?pp</span>:<span>string <a href="../../../fmt/Fmt/index.html#type-t">Fmt.t</a></span> <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>make label</code> is a mock Eio flow. It can be used as a source, sink, or two-way flow.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">pp</span> <p>Printer to use to display the data.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-on_read"><a href="#val-on_read" class="anchor"></a><code><span><span class="keyword">val</span> on_read : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>string <a href="../Handler/index.html#type-actions">Handler.actions</a></span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>on_read t actions</code> configures the values to return from the mock's <code>read</code> function.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-on_copy_bytes"><a href="#val-on_copy_bytes" class="anchor"></a><code><span><span class="keyword">val</span> on_copy_bytes : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int <a href="../Handler/index.html#type-actions">Handler.actions</a></span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>on_copy_bytes t actions</code> configures the number of bytes to copy in each iteration.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set_copy_method"><a href="#val-set_copy_method" class="anchor"></a><code><span><span class="keyword">val</span> set_copy_method : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-copy_method">copy_method</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>set_copy_method t m</code> configures <code>t</code> to use the given method to read from a source during a copy operation.</p></div></div></div></body></html>