tiny_httpd/0.9/tiny_httpd/Tiny_httpd/Byte_stream/index.html
2021-07-18 00:10:03 -04:00

2 lines
No EOL
4.7 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>Byte_stream (tiny_httpd.Tiny_httpd.Byte_stream)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd</a> &#x00BB; Byte_stream</nav><h1>Module <code>Tiny_httpd.Byte_stream</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = <a href="../index.html#type-byte_stream">byte_stream</a></code></dt></dl><dl><dt class="spec value" id="val-close"><a href="#val-close" class="anchor"></a><code><span class="keyword">val</span> close : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-empty"><a href="#val-empty" class="anchor"></a><code><span class="keyword">val</span> empty : <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-of_chan"><a href="#val-of_chan" class="anchor"></a><code><span class="keyword">val</span> of_chan : Stdlib.in_channel <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Make a buffered stream from the given channel.</p></dd></dl><dl><dt class="spec value" id="val-of_chan_close_noerr"><a href="#val-of_chan_close_noerr" class="anchor"></a><code><span class="keyword">val</span> of_chan_close_noerr : Stdlib.in_channel <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Same as <a href="index.html#val-of_chan"><code>of_chan</code></a> but the <code>close</code> method will never fail.</p></dd></dl><dl><dt class="spec value" id="val-of_bytes"><a href="#val-of_bytes" class="anchor"></a><code><span class="keyword">val</span> of_bytes : <span>?&#8288;i:int</span> <span>&#45;&gt;</span> <span>?&#8288;len:int</span> <span>&#45;&gt;</span> bytes <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>A stream that just returns the slice of bytes starting from <code>i</code> and of length <code>len</code>.</p></dd></dl><dl><dt class="spec value" id="val-of_string"><a href="#val-of_string" class="anchor"></a><code><span class="keyword">val</span> of_string : string <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-iter"><a href="#val-iter" class="anchor"></a><code><span class="keyword">val</span> iter : <span>(bytes <span>&#45;&gt;</span> int <span>&#45;&gt;</span> int <span>&#45;&gt;</span> unit)</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p>Iterate on the chunks of the stream</p><dl><dt>since</dt><dd>0.3</dd></dl></dd></dl><dl><dt class="spec value" id="val-to_chan"><a href="#val-to_chan" class="anchor"></a><code><span class="keyword">val</span> to_chan : Stdlib.out_channel <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p>Write the stream to the channel.</p><dl><dt>since</dt><dd>0.3</dd></dl></dd></dl><dl><dt class="spec value" id="val-with_file"><a href="#val-with_file" class="anchor"></a><code><span class="keyword">val</span> with_file : string <span>&#45;&gt;</span> <span>(<a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'a</span>)</span> <span>&#45;&gt;</span> <span class="type-var">'a</span></code></dt><dd><p>Open a file with given name, and obtain an input stream on its content. When the function returns, the stream (and file) are closed.</p></dd></dl><dl><dt class="spec value" id="val-read_line"><a href="#val-read_line" class="anchor"></a><code><span class="keyword">val</span> read_line : <span>?&#8288;buf:<a href="../Buf_/index.html#type-t">Buf_.t</a></span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> string</code></dt><dd><p>Read a line from the stream.</p><dl><dt>parameter buf</dt><dd><p>a buffer to (re)use. Its content will be cleared.</p></dd></dl></dd></dl><dl><dt class="spec value" id="val-read_all"><a href="#val-read_all" class="anchor"></a><code><span class="keyword">val</span> read_all : <span>?&#8288;buf:<a href="../Buf_/index.html#type-t">Buf_.t</a></span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> string</code></dt><dd><p>Read the whole stream into a string.</p><dl><dt>parameter buf</dt><dd><p>a buffer to (re)use. Its content will be cleared.</p></dd></dl></dd></dl></div></body></html>