API reference

The library crates are deed (package deedar-deed) and deedar. deedar-cli and deedar-mcp are binaries. Their commands are on the reference page, and the server’s tools are on the how-to. The data those types store is drawn on the concepts page.

The tables below are generated from the rustdoc HTML of:

$ cargo doc --no-deps --locked -p deedar-deed -p deedar

Documenting the whole workspace would let the deedar binary replace the deedar library pages, because both use that output directory. ./docs/build.sh runs the command above, exports these pages, builds the HTML, and copies target/doc to rustdoc/ beside them. Each item links there. The Sphinx search covers the tables. The copied rustdoc has its own search box.

Crates#

rustdoc 0.7.1.

deed#

A named product of a unit of work: a deed the next unit opens by id.

rustdoc

Structs

  • Deed (struct). The work plus its identity. The next unit opens it by id.

  • DeedId (struct). Accession: deed-<kind>-<slug>.

  • Draft (struct). Constructor input. from_draft is the shipped assemble.

  • Evidence (struct). Writer-issued evidence about a deed.

  • FormField (struct).

  • MailMessageId (struct). RFC 5322 msg-id, stored as <local@domain>.

  • Measure (struct).

  • ProducedBy (struct). Who made the deed. activity_id is an optional assignment id (a claimdag WorkId when that graph is the caller).

  • Step (struct).

Enums

  • Body (enum). Kind-specific product. Adding a variant does not rewrite the envelope.

  • Error (enum).

  • Face (enum). How a viewer looks at a deed. Face follows media type and body.

  • Grant (enum). Host or path the seat allowed this sitting.

  • Kind (enum). Closed catalog. Each kind is a handler.

  • Source (enum). Prior deed, a path, or a URL. trail walks deed sources.

Functions

  • walk_trail (fn). Walk sources that name other deeds.

Types

deedar#

One-writer deed store. Clients speak the Cap’n schema via Client.

rustdoc

deedar::log#

An append-only Merkle log over the deeds a store has issued, hashed as RFC 9162 (doi:10.17487/RFC9162): leaf SHA-256(0x00 || entry), node SHA-256(0x01 || left || right). Inclusion proofs catch a dropped deed; consistency proofs catch a rewritten log. Signatures alone bind neither. Gossip lives outside this file. Two consistent logs shown to two readers both verify here.

rustdoc

Structs

  • Entry (struct). One entry: the deed’s content address and the instant it was logged.

  • Head (struct). What a store publishes: how many entries it has, and the root over them.

Functions

  • consistency_proof (fn). The consistency proof that a tree of old leaves is a prefix of these, RFC 9162 section 2.1.4. The nodes recompute both roots; a rewritten log cannot produce a set that yields both. None when old is zero or wider than the tree.

  • from_hex (fn). A 32 byte hash from the lower-case hex hex writes. Any other text yields nothing.

  • hex (fn). Hex, lower case, fixed width.

  • inclusion_proof (fn). The audit path for the leaf at index, RFC 9162 section 2.1.3: sibling subtree roots, innermost first.

  • leaf_hash (fn). Leaf hash, SHA-256(0x00 || entry).

  • node_hash (fn). Interior hash, SHA-256(0x01 || left || right).

  • root (fn). The Merkle root over leaves, RFC 9162 section 2.1: the tree splits at the largest power of two below the width, which is the shape the proofs below are sound over.

  • verify_consistency (fn). Whether the tree of old leaves with old_root is a prefix of the tree of new leaves with new_root; both roots are recomputed from nodes.

  • verify_inclusion (fn). Whether leaf sits at index of a tree of size leaves with that root.

deedar::receipt#

Checking a deed somebody else handed over.

rustdoc

Structs

  • Bridge (struct). One head against an earlier one from the same log: the consistency proof that catches a log rewritten between handovers.

  • Handover (struct). What checking a whole handover established.

  • Receipt (struct). One deed’s place in a log, as an export writes it beside the bytes.

  • SignedHead (struct). A head with a signature over it: RFC 9162’s signed tree head. Unsigned, a head is two numbers that arrived in the same bag as the deeds they vouch for.

Functions

  • check_handover (fn). Check every deed a handover carried, given the bag or the deeds directory.

  • check_since (fn). Whether the log behind now is the log behind kept, grown.

  • head_beside (fn). The file a handover carries its signed head in.

  • kept_head (fn). Read the head a receiver kept from an earlier handover.

  • sign_head (fn). Sign a head with this host’s key.

deedar::vouch#

Signing a file that somebody else will open.

rustdoc

Structs

  • Checked (struct). What a check established.

  • Vouch (struct). What a detached signature file holds.

Functions

  • beside (fn). Where the signature for path lives.

  • check (fn). Check the signature beside a file against the keys a reader accepts.

  • manifest_in (fn). The manifest inside a satchel, which is the file worth signing.

  • sign (fn). Sign a file, writing the signature beside it.

Structs

  • Audit (struct). What an audit found in both directions: logged and gone is tampering; served and never logged is a store that wants backfilling. A deed file that does not read, and that the log does not name, is unreadable.

  • Client (struct). Cap’n client. Same path the deedar command uses.

  • CreateRequest (struct). Agent and grants the writer stamps onto the deed.

  • Deed (struct). The work plus its identity. The next unit opens it by id.

  • DeedId (struct). Accession: deed-<kind>-<slug>.

  • Draft (struct). Constructor input. from_draft is the shipped assemble.

  • Evidence (struct). Writer-issued evidence about a deed.

  • Exporter (struct). One reading of the log, held for a handover of many deeds; see FsStore::exporter. Every receipt is a lookup in a tree built once.

  • Filter (struct). Which rows of Client::list to keep.

  • FormField (struct).

  • FsStore (struct). Directory of deeds, write-once bytes, and tombstones.

  • Imported (struct). What an import checked, and what it added to this store.

  • MailMessageId (struct). RFC 5322 msg-id, stored as <local@domain>.

  • Measure (struct).

  • Missing (struct). A deed the log names that the store no longer serves as logged.

  • Policy (struct). What {store}/layout says about host attestation.

  • ProducedBy (struct). Who made the deed. activity_id is an optional assignment id (a claimdag WorkId when that graph is the caller).

  • Step (struct).

  • StoreUrl (struct). DEEDAR_URL contract: file:///abs/path is the store.

Enums

  • Body (enum). Kind-specific product. Adding a variant does not rewrite the envelope.

  • Demand (enum). Whether a store demands an attestation before it will hand a deed over.

  • Error (enum).

  • Face (enum). How a viewer looks at a deed. Face follows media type and body.

  • Grant (enum). Host or path the seat allowed this sitting.

  • Kind (enum). Closed catalog. Each kind is a handler.

  • Request (enum).

  • Response (enum).

  • Source (enum). Prior deed, a path, or a URL. trail walks deed sources.

  • UnsignedHead (enum). Whether an import appends under a head this store did not accept.

  • Walk (enum). Where the walk from one accession ended.

Constants

  • EXIT_UNTRUSTED_SIGNER (constant). Status of deedar check and deedar vouch check when the check finished and the signer was not one the reader accepts.

  • PREFIX_CANDIDATES_SHOWN (constant). Accessions an ambiguous-prefix line prints.

Functions

Types