mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
2 lines
No EOL
4.7 KiB
HTML
2 lines
No EOL
4.7 KiB
HTML
<!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> » <a href="../index.html">Tiny_httpd</a> » 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>-></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>-></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>-></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>?⁠i:int</span> <span>-></span> <span>?⁠len:int</span> <span>-></span> bytes <span>-></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>-></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>-></span> int <span>-></span> int <span>-></span> unit)</span> <span>-></span> <a href="index.html#type-t">t</a> <span>-></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>-></span> <a href="index.html#type-t">t</a> <span>-></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>-></span> <span>(<a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'a</span>)</span> <span>-></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>?⁠buf:<a href="../Buf_/index.html#type-t">Buf_.t</a></span> <span>-></span> <a href="index.html#type-t">t</a> <span>-></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>?⁠buf:<a href="../Buf_/index.html#type-t">Buf_.t</a></span> <span>-></span> <a href="index.html#type-t">t</a> <span>-></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> |