ocaml-containers/dev/containers-data/CCHashTrie/Transient/index.html
2022-12-22 22:16:34 +00:00

2 lines
No EOL
4.2 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>Transient (containers-data.CCHashTrie.Transient)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.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">containers-data</a> &#x00BB; <a href="../index.html">CCHashTrie</a> &#x00BB; Transient</nav><header class="odoc-preamble"><h1>Module <code><span>CCHashTrie.Transient</span></code></h1></header><nav class="odoc-toc"><ul><li><a href="#transient-identifiers">Transient Identifiers</a></li></ul></nav><div class="odoc-content"><h3 id="transient-identifiers"><a href="#transient-identifiers" class="anchor"></a>Transient Identifiers</h3><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></code></div><div class="spec-doc"><p>Identifiers for transient modifications. A transient modification is uniquely identified by a <code>Transient.t</code>. Once <code>Transient.freeze r</code> is called, <code>r</code> cannot be used to modify the structure again.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Create a new, active ID.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-equal"><a href="#val-equal" class="anchor"></a><code><span><span class="keyword">val</span> equal : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p>Equality between IDs.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-frozen"><a href="#val-frozen" class="anchor"></a><code><span><span class="keyword">val</span> frozen : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p><code>frozen i</code> returns <code>true</code> if <code>freeze i</code> was called before. In this case, the ID cannot be used for modifications again.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-active"><a href="#val-active" class="anchor"></a><code><span><span class="keyword">val</span> active : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p><code>active i</code> is <code>not (frozen i)</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-freeze"><a href="#val-freeze" class="anchor"></a><code><span><span class="keyword">val</span> freeze : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>freeze i</code> makes <code>i</code> unusable for new modifications. The values created with <code>i</code> will now be immutable.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_"><a href="#val-with_" class="anchor"></a><code><span><span class="keyword">val</span> with_ : <span><span>(<span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>with_ f</code> creates a transient ID <code>i</code>, calls <code>f i</code>, freezes the ID <code>i</code> and returns the result of <code>f i</code>.</p></div></div><div class="odoc-spec"><div class="spec exception anchored" id="exception-Frozen"><a href="#exception-Frozen" class="anchor"></a><code><span><span class="keyword">exception</span> </span><span><span class="exception">Frozen</span></span></code></div><div class="spec-doc"><p>Raised when a frozen ID is used.</p></div></div></div></body></html>