Files

11 lines
4.7 KiB
HTML
Raw Permalink 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>Persistence (capnp-rpc.Capnp_rpc.Persistence)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.4"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/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">capnp-rpc</a> &#x00BB; <a href="../index.html">Capnp_rpc</a> &#x00BB; Persistence</nav><header class="odoc-preamble"><h1>Module <code><span>Capnp_rpc.Persistence</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec class-type anchored" id="class-type-persistent"><a href="#class-type-persistent" class="anchor"></a><code><span><span class="keyword">class</span> <span class="keyword">type</span> 'a </span><span><a href="class-type-persistent/index.html">persistent</a></span><span> = <span class="keyword">object</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_persistence"><a href="#val-with_persistence" class="anchor"></a><code><span><span class="keyword">val</span> with_persistence :
<span><span><span class="type-var">'a</span> <a href="class-type-persistent/index.html">persistent</a></span> <span class="arrow">&#45;&gt;</span></span>
<span><span>(<span><span class="type-var">'impl</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="../Capability/index.html#type-t">Capability.t</a></span>)</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="xref-unresolved">{Untyped}1.generic_service</span> <span class="keyword">as</span> 'impl <span class="arrow">&#45;&gt;</span></span>
<span><span class="type-var">'a</span> <a href="../Capability/index.html#type-t">Capability.t</a></span></span></code></div><div class="spec-doc"><p><code>with_persistence persist Service.Foo.local obj</code> is like <code>Service.Foo.local obj</code>, but the resulting service also handles the Cap'n Proto persistence protocol, using <code>persist</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_sturdy_ref"><a href="#val-with_sturdy_ref" class="anchor"></a><code><span><span class="keyword">val</span> with_sturdy_ref :
<span><span><span class="type-var">'a</span> <a href="../Sturdy_ref/index.html#type-t">Sturdy_ref.t</a></span> <span class="arrow">&#45;&gt;</span></span>
<span><span>(<span><span class="type-var">'impl</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="../Capability/index.html#type-t">Capability.t</a></span>)</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="xref-unresolved">{Untyped}1.generic_service</span> <span class="keyword">as</span> 'impl <span class="arrow">&#45;&gt;</span></span>
<span><span class="type-var">'a</span> <a href="../Capability/index.html#type-t">Capability.t</a></span></span></code></div><div class="spec-doc"><p><code>with_sturdy_ref sr Service.Foo.local obj</code> is like <code>Service.Foo.local obj</code>, but responds to <code>save</code> calls by returning <code>sr</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-save"><a href="#val-save" class="anchor"></a><code><span><span class="keyword">val</span> save : <span><span><span class="type-var">'a</span> <a href="../Capability/index.html#type-t">Capability.t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span class="xref-unresolved">Uri</span>.t, <span>[&gt; <span>`Capnp of <a href="../../Capnp_rpc_proto/Error/index.html#type-t">Error.t</a></span> ]</span>)</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p><code>save cap</code> calls the persistent <code>save</code> method on <code>cap</code>. Note that not all capabilities can be saved. todo: this should return an <code>'a Sturdy_ref.t</code>; see <a href="../Sturdy_ref/index.html#val-reader"><code>Sturdy_ref.reader</code></a>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-save_exn"><a href="#val-save_exn" class="anchor"></a><code><span><span class="keyword">val</span> save_exn : <span><span><span class="type-var">'a</span> <a href="../Capability/index.html#type-t">Capability.t</a></span> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Uri</span>.t</span></code></div><div class="spec-doc"><p><code>save_exn</code> is a wrapper for <code>save</code> that returns a failed thread on error.</p></div></div></div></body></html>