1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! The value encoding at the host boundary (`docs/runtime/spec/abi.md`).
//!
//! Every Flow data value that leaves a run's address space, and every value
//! history stores, is JSON under one set of rules, and both sides know the
//! declared type, so the encoding carries no type tags of its own. This crate
//! is those rules:
//!
//! - [`encode`] writes a value at its type, and [`canonical`] gives the one
//! text every equal value shares, over which every hash is taken
//! ([`Digest`]);
//! - [`decode`] and [`decode_text`] build a value of a declared type from
//! JSON by the decoding table, refusing with where and why
//! ([`DecodeError`]), in reply or run-input [`Mode`] and within [`Limits`],
//! and rebuild a value the program made from its canonical text;
//! - [`encode_checkpoint`] and [`rebuild`] write and read a checkpoint's
//! arguments, the one place a task has an encoding: the id of the call it
//! is parked on;
//! - [`schema`] writes a type's JSON Schema;
//! - [`TypeSpec`] validates finite declaration templates and concrete generic
//! calls, with [`Terms`] and [`call_types`] sharing their one term writer;
//! - [`Signature::fingerprint`] hashes a `@tool` declaration's canonical
//! signature.
//!
//! # The types it reads
//!
//! The encoding is a function of declarations, not of checking, so this
//! crate does not depend on the checker. It reads a [`Type`] — the checker's
//! types cut down to what crosses — whose declared records, enums and host
//! types live in a [`Catalog`] that holds the same `flow-value` shapes the
//! evaluator builds values with. Whoever holds a checked program builds the
//! catalog from it once; a history reader or a host needs only the catalog.
//!
//! # JSON
//!
//! The reader and writer are this crate's own ([`Json`], [`parse`]): numbers
//! are exact at any size, an object naming a key twice and a lone surrogate
//! escape are refused, nesting is bounded, and the writer is the canonical
//! form. No dynamic tree from a general-purpose library stands beside the
//! type-directed one.
//!
//! # Not here
//!
//! The Tool process protocol's messages, binding, `flow.toml`, toolkits
//! and adapters are the host's, built on this crate.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use crossable;
pub use Limits;
pub use ;
pub use ;
pub use ;
/// The data version: one version for the value encoding, the Tool protocol
/// and the history format together, written `"major.minor"` (`abi.md`,
/// `trace.md`, *The data version*). No data version is stable before the
/// first public release.
pub const DATA_VERSION: &str = "0.1";