Files
bookspec/target/doc/bookspec_checker/engine/trait.Engine.html
T
swaitsandClaude Fable 5.1 73dd967b1a
check / check (push) Canceled after 0s
feat(checker): examples() and spec_files() carry the specification's files
A consumer of the checker crate needs no path into this repository.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 16:35:29 -06:00

30 lines
12 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 lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An accounting engine, as bookspec checks it."><title>Engine in bookspec_checker::engine - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-0c87338a.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bookspec_checker" data-themes="" data-resource-suffix="" data-rustdoc-version="1.99.1 (58cf8f9c3 2026-10-13)" data-channel="1.99.1" data-search-js="search-cf4fc35e.js" data-stringdex-js="stringdex-b5109af9.js" data-settings-js="settings-170eb4bf.js" ><script src="../../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-417ebf0a.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-9f56287d.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Engine</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bookspec_checker/index.html">bookspec_<wbr>checker</a><span class="version">0.1.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Engine</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.apply" title="apply">apply</a></li><li><a href="#tymethod.change" title="change">change</a></li><li><a href="#tymethod.claims" title="claims">claims</a></li><li><a href="#tymethod.load" title="load">load</a></li><li><a href="#tymethod.query" title="query">query</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In bookspec_<wbr>checker::<wbr>engine</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bookspec_checker</a>::<wbr><a href="index.html">engine</a></div><h1>Trait <span class="trait">Engine</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/bookspec_checker/engine.rs.html#193-218">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Engine {
// Required methods
fn <a href="#tymethod.load" class="fn">load</a>(&amp;mut self, setup: &amp;<a class="struct" href="../schema/struct.Setup.html" title="struct bookspec_checker::schema::Setup">Setup</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.99.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.99.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Refusal.html" title="struct bookspec_checker::engine::Refusal">Refusal</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.apply" class="fn">apply</a>(&amp;mut self, event: &amp;<a class="struct" href="../schema/struct.Event.html" title="struct bookspec_checker::schema::Event">Event</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.99.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.99.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Refusal.html" title="struct bookspec_checker::engine::Refusal">Refusal</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.query" class="fn">query</a>(&amp;self, q: &amp;<a class="struct" href="../schema/struct.Query.html" title="struct bookspec_checker::schema::Query">Query</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.99.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://docs.rs/serde_json/1.0.154/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="struct.Refusal.html" title="struct bookspec_checker::engine::Refusal">Refusal</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.claims" class="fn">claims</a>(&amp;self) -&gt; <a class="struct" href="struct.Claims.html" title="struct bookspec_checker::engine::Claims">Claims</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.change" class="fn">change</a>(&amp;mut self, change: &amp;<a class="struct" href="../schema/struct.ChangeSpec.html" title="struct bookspec_checker::schema::ChangeSpec">ChangeSpec</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.99.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.99.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Refusal.html" title="struct bookspec_checker::engine::Refusal">Refusal</a>&gt;;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An accounting engine, as bookspec checks it.</p>
<p>The four methods are the plan’s (<code>plan/served.md</code> 8.2 P13 step 2); the
fifth, <a href="trait.Engine.html#tymethod.change" title="method bookspec_checker::engine::Engine::change"><code>Engine::change</code></a>, is the one departure: an example’s
<code>[[changes]]</code> (a rename, the tax-category policy, an asset correction)
posts no entry, so it is neither a setup nor an event, and the plan’s
four methods have no path for it. It is required, never defaulted, so
an engine cannot silently skip the examples that use one.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.load" class="method"><a class="src rightside" href="../../src/bookspec_checker/engine.rs.html#197">Source</a><h4 class="code-header">fn <a href="#tymethod.load" class="fn">load</a>(&amp;mut self, setup: &amp;<a class="struct" href="../schema/struct.Setup.html" title="struct bookspec_checker::schema::Setup">Setup</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.99.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.99.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Refusal.html" title="struct bookspec_checker::engine::Refusal">Refusal</a>&gt;</h4></section></summary><div class="docblock"><p>Set the books up: the chart, the fixed assets, the schedules, the
parties, the members, the payees and their dated decisions, the
payment methods and the projects.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.apply" class="method"><a class="src rightside" href="../../src/bookspec_checker/engine.rs.html#203">Source</a><h4 class="code-header">fn <a href="#tymethod.apply" class="fn">apply</a>(&amp;mut self, event: &amp;<a class="struct" href="../schema/struct.Event.html" title="struct bookspec_checker::schema::Event">Event</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.99.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.99.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Refusal.html" title="struct bookspec_checker::engine::Refusal">Refusal</a>&gt;</h4></section></summary><div class="docblock"><p>Apply one event: an entry, a reversal, a close, a bill, an invoice,
a depreciation run, a disposal, a schedules run or a schedule’s
registration. An event the engine refuses leaves the books as they
were.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.query" class="method"><a class="src rightside" href="../../src/bookspec_checker/engine.rs.html#211">Source</a><h4 class="code-header">fn <a href="#tymethod.query" class="fn">query</a>(&amp;self, q: &amp;<a class="struct" href="../schema/struct.Query.html" title="struct bookspec_checker::schema::Query">Query</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.99.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://docs.rs/serde_json/1.0.154/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="struct.Refusal.html" title="struct bookspec_checker::engine::Refusal">Refusal</a>&gt;</h4></section></summary><div class="docblock"><p>Answer one query with the engine’s own figures. A figure is an
exact decimal string (never a JSON number: no engine may round a
cent through a float), a date is <code>YYYY-MM-DD</code>, and a format
query’s value is its lines or rows. A query the engine refuses
(a period the rule refuses, a command it refuses) is an
<a href="https://doc.rust-lang.org/1.99.1/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Err</code></a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.claims" class="method"><a class="src rightside" href="../../src/bookspec_checker/engine.rs.html#214">Source</a><h4 class="code-header">fn <a href="#tymethod.claims" class="fn">claims</a>(&amp;self) -&gt; <a class="struct" href="struct.Claims.html" title="struct bookspec_checker::engine::Claims">Claims</a></h4></section></summary><div class="docblock"><p>The rules and choices this engine declares.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.change" class="method"><a class="src rightside" href="../../src/bookspec_checker/engine.rs.html#217">Source</a><h4 class="code-header">fn <a href="#tymethod.change" class="fn">change</a>(&amp;mut self, change: &amp;<a class="struct" href="../schema/struct.ChangeSpec.html" title="struct bookspec_checker::schema::ChangeSpec">ChangeSpec</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.99.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.99.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Refusal.html" title="struct bookspec_checker::engine::Refusal">Refusal</a>&gt;</h4></section></summary><div class="docblock"><p>Apply one change that posts no entry (a <code>[[changes]]</code> entry).</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait <b>is</b> <a href="https://doc.rust-lang.org/1.99.1/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety".</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../trait.impl/bookspec_checker/engine/trait.Engine.js" async></script></section></div></main></body></html>