Files
bookspec/target/doc/bookspec_checker/schema/index.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

31 lines
14 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="The shape of a bookspec example: the TOML schema, the parser, and the rules a well-formed example follows whatever engine runs it."><title>bookspec_checker::schema - 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 mod"><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="#">Module schema</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="#">Module schema</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate bookspec_<wbr>checker</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></div><h1>Module <span>schema</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/schema.rs.html#1-1941">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The shape of a bookspec example: the TOML schema, the parser, and the
rules a well-formed example follows whatever engine runs it.</p>
<p>One file per example, named for its <code>id</code> (<code>bookspec/README.md</code> gives the
shape in prose; this module is its executable form). Every structure
refuses a key it does not know (<code>deny_unknown_fields</code>): a typo is an
error, never silently ignored. <a href="struct.Example.html#method.from_toml" title="associated function bookspec_checker::schema::Example::from_toml"><code>Example::from_toml</code></a> parses and then
checks the shape; an engine’s own adapter only has to execute it.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.AccountSpec.html" title="struct bookspec_checker::schema::AccountSpec">Account<wbr>Spec</a></dt><dd>One account of the chart.</dd><dt><a class="struct" href="struct.AssetSpec.html" title="struct bookspec_checker::schema::AssetSpec">Asset<wbr>Spec</a></dt><dd>A fixed asset registered before the first event (B-15).</dd><dt><a class="struct" href="struct.BasisSpec.html" title="struct bookspec_checker::schema::BasisSpec">Basis<wbr>Spec</a></dt><dd>An asset’s basis facts (B-25).</dd><dt><a class="struct" href="struct.BillSpec.html" title="struct bookspec_checker::schema::BillSpec">Bill<wbr>Spec</a></dt><dd>A bill from <code>vendor</code> (B-38).</dd><dt><a class="struct" href="struct.ChangeSpec.html" title="struct bookspec_checker::schema::ChangeSpec">Change<wbr>Spec</a></dt><dd>A change to the books that posts no entry, made right after event
<code>after</code> once that event’s expectations are checked: exactly one of
<code>rename</code>, <code>require_tax_category</code> and <code>correct_asset</code>.</dd><dt><a class="struct" href="struct.CloseSpec.html" title="struct bookspec_checker::schema::CloseSpec">Close<wbr>Spec</a></dt><dd>A close of the period from <code>start</code> through the event’s date (B-11,
B-13).</dd><dt><a class="struct" href="struct.CorrectSpec.html" title="struct bookspec_checker::schema::CorrectSpec">Correct<wbr>Spec</a></dt><dd>A registered asset’s economics corrected for <code>reason</code>: each figure
given replaces the asset’s; the rest stay.</dd><dt><a class="struct" href="struct.DisposeSpec.html" title="struct bookspec_checker::schema::DisposeSpec">Dispose<wbr>Spec</a></dt><dd>A fixed asset’s disposal (B-15).</dd><dt><a class="struct" href="struct.DocumentLineSpec.html" title="struct bookspec_checker::schema::DocumentLineSpec">Document<wbr>Line<wbr>Spec</a></dt><dd>One line of an invoice or a bill.</dd><dt><a class="struct" href="struct.Event.html" title="struct bookspec_checker::schema::Event">Event</a></dt><dd>One event: an entry, a reversal, a close, a bill, an invoice, a
command that posts what is due, or a schedule’s registration.</dd><dt><a class="struct" href="struct.Example.html" title="struct bookspec_checker::schema::Example">Example</a></dt><dd>One bookspec example: a setup, its events and changes, and what it
expects of the books.</dd><dt><a class="struct" href="struct.Expect.html" title="struct bookspec_checker::schema::Expect">Expect</a></dt><dd>One expectation: a query, the dates or things it asks about, and what
it expects.</dd><dt><a class="struct" href="struct.FixedAsset.html" title="struct bookspec_checker::schema::FixedAsset">Fixed<wbr>Asset</a></dt><dd>Accounts that hold property and equipment, for an example no asset’s
own figures matter to.</dd><dt><a class="struct" href="struct.InstrumentSpec.html" title="struct bookspec_checker::schema::InstrumentSpec">Instrument<wbr>Spec</a></dt><dd>A payment method (B-19).</dd><dt><a class="struct" href="struct.InvoiceSpec.html" title="struct bookspec_checker::schema::InvoiceSpec">Invoice<wbr>Spec</a></dt><dd>An invoice to <code>customer</code> (B-38).</dd><dt><a class="struct" href="struct.LineSpec.html" title="struct bookspec_checker::schema::LineSpec">Line<wbr>Spec</a></dt><dd>One line of an entry.</dd><dt><a class="struct" href="struct.MemberSpec.html" title="struct bookspec_checker::schema::MemberSpec">Member<wbr>Spec</a></dt><dd>One member of a multi-member LLC (B-13).</dd><dt><a class="struct" href="struct.PartySpec.html" title="struct bookspec_checker::schema::PartySpec">Party<wbr>Spec</a></dt><dd>One party in the directory (B-26, B-35).</dd><dt><a class="struct" href="struct.PayeeSpec.html" title="struct bookspec_checker::schema::PayeeSpec">Payee<wbr>Spec</a></dt><dd>A payee marked for an information return from the beginning (B-19).</dd><dt><a class="struct" href="struct.ProjectSpec.html" title="struct bookspec_checker::schema::ProjectSpec">Project<wbr>Spec</a></dt><dd>A project (B-37): its name, and its kind, status and party if given.</dd><dt><a class="struct" href="struct.Query.html" title="struct bookspec_checker::schema::Query">Query</a></dt><dd>The question an expectation asks: everything but the answer.</dd><dt><a class="struct" href="struct.RenameSpec.html" title="struct bookspec_checker::schema::RenameSpec">Rename<wbr>Spec</a></dt><dd>Rename the account <code>code</code> to <code>name</code> (B-31).</dd><dt><a class="struct" href="struct.RunSchedulesSpec.html" title="struct bookspec_checker::schema::RunSchedulesSpec">RunSchedules<wbr>Spec</a></dt><dd>Every schedule’s months due through <code>through</code> (B-16).</dd><dt><a class="struct" href="struct.RunSpec.html" title="struct bookspec_checker::schema::RunSpec">RunSpec</a></dt><dd>A depreciation run of <code>asset</code> for <code>period</code> (<code>YYYY-MM</code>), dated at the
month’s end (B-15).</dd><dt><a class="struct" href="struct.ScheduleSpec.html" title="struct bookspec_checker::schema::ScheduleSpec">Schedule<wbr>Spec</a></dt><dd>A prepaid expense or deferred revenue recognized over its months
(B-16), in <code>setup.schedules</code> or registered by an event.</dd><dt><a class="struct" href="struct.SchemaError.html" title="struct bookspec_checker::schema::SchemaError">Schema<wbr>Error</a></dt><dd>Why an example is not well formed.</dd><dt><a class="struct" href="struct.Setup.html" title="struct bookspec_checker::schema::Setup">Setup</a></dt><dd>The books an example sets up, before any event.</dd><dt><a class="struct" href="struct.ShareSpec.html" title="struct bookspec_checker::schema::ShareSpec">Share<wbr>Spec</a></dt><dd>A party named on an entry, with its share (B-35).</dd><dt><a class="struct" href="struct.StatusChangeSpec.html" title="struct bookspec_checker::schema::StatusChangeSpec">Status<wbr>Change<wbr>Spec</a></dt><dd>A payee’s 1099 decision from <code>effective</code> on (B-19, D-40).</dd><dt><a class="struct" href="struct.WriteOffSpec.html" title="struct bookspec_checker::schema::WriteOffSpec">Write<wbr>OffSpec</a></dt><dd>A write-off of the invoice an earlier event posted (rules.md B-41;
plan P4b S7): the invoice’s event, what to write off and why.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.EventKind.html" title="enum bookspec_checker::schema::EventKind">Event<wbr>Kind</a></dt><dd>The kind of an event.</dd><dt><a class="enum" href="enum.Values.html" title="enum bookspec_checker::schema::Values">Values</a></dt><dd>What a query expects: figures by key (every figure an exact decimal
string), or, for a file format, its lines or its rows of fields.</dd></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.COMMANDS.html" title="constant bookspec_checker::schema::COMMANDS">COMMANDS</a></dt><dd>The commands an example may try: each on a copy of the books, so it
changes nothing checked after it.</dd><dt><a class="constant" href="constant.COMPLETE_QUERIES.html" title="constant bookspec_checker::schema::COMPLETE_QUERIES">COMPLETE_<wbr>QUERIES</a></dt><dd>The queries whose example lists every value it covers, so a value left
out of an example is an error. The others name the figures they show:
<code>cash_flow</code>, the statements, the register, a schedule’s plan and an
asset’s basis.</dd><dt><a class="constant" href="constant.EXEMPT_REASONS.html" title="constant bookspec_checker::schema::EXEMPT_REASONS">EXEMPT_<wbr>REASONS</a></dt><dd>Why a party is not reportable (B-19).</dd><dt><a class="constant" href="constant.FORMAT_QUERIES.html" title="constant bookspec_checker::schema::FORMAT_QUERIES">FORMAT_<wbr>QUERIES</a></dt><dd>The formats appendix’s queries.</dd><dt><a class="constant" href="constant.QUERIES.html" title="constant bookspec_checker::schema::QUERIES">QUERIES</a></dt><dd>The queries every engine must answer: the figure queries first, then
the calendar ones, then the commands (tried on a copy of the books),
then the formats appendix’s.</dd><dt><a class="constant" href="constant.ROLES.html" title="constant bookspec_checker::schema::ROLES">ROLES</a></dt><dd>The party roles the specification names.</dd><dt><a class="constant" href="constant.TEXT_VALUED.html" title="constant bookspec_checker::schema::TEXT_VALUED">TEXT_<wbr>VALUED</a></dt><dd>The queries whose figures may be text rather than an exact decimal
string: a status, a direction, a date, a year, a name, a rule name,
<code>"none"</code>, <code>"open"</code>, <code>"true"</code> or <code>"false"</code>, and the register’s dates
beside its figures.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.is_date.html" title="fn bookspec_checker::schema::is_date">is_date</a></dt><dd>A date, <code>YYYY-MM-DD</code> and a real day.</dd><dt><a class="fn" href="fn.is_exact_decimal.html" title="fn bookspec_checker::schema::is_exact_decimal">is_<wbr>exact_<wbr>decimal</a></dt><dd>An exact decimal string: digits, an optional sign and point; never an
exponent, never a float.</dd><dt><a class="fn" href="fn.is_month.html" title="fn bookspec_checker::schema::is_month">is_<wbr>month</a></dt><dd>A month, <code>YYYY-MM</code>.</dd><dt><a class="fn" href="fn.refusal_reasons.html" title="fn bookspec_checker::schema::refusal_reasons">refusal_<wbr>reasons</a></dt><dd>Every refusal reason the specification names (bookspec/README.md), each
the reason of exactly one rule (see <a href="../rules/fn.rule_for_refusal.html" title="fn bookspec_checker::rules::rule_for_refusal"><code>crate::rules::rule_for_refusal</code></a>).</dd></dl></section></div></main></body></html>