mod.rsannotatedmod.rssource24 lines · 1.3 KB · raw
1//! The conformance suite: the contracts of `whiskers-ports`, written as functions generic over an
2//! adapter. An adapter's own tests call these with a way to make a fresh one (and, for the durable
3//! ports, a way to restart one on the same storage). The suite is the specification: if a contract
4//! needs to change, the law here changes with it, and every adapter is held to it at once.
5//!
6//! Nothing in the suite uses a thread, a clock or a file, so it builds for a Worker too; an adapter
7//! that needs a real runtime supplies it around these calls. The laws are synchronous because every
8//! adapter whose futures never wait can be driven by `whiskers_ports::run_ready`; an adapter that
9//! does wait (a Durable Object) is driven by its own harness, which wraps each call in a runner.
10//!
11//! **Laws are selected by capability** (see [`fixture`]). Each law set names, in the fixture trait it needs,
12//! the one capability it judges, and a [`fixture::Suite`] can run it only for a harness that provides that
13//! fixture: an adapter without a journal has no `JournalFixture` and so has no way to select the journal's
14//! laws, rather than skipping them.
15
16pub mod allowance;
17pub mod build;
18pub mod fixture;
19pub mod hubs;
20pub mod journal;
21pub mod outbound;
22pub mod pictures;
23pub mod secrets;
24pub mod timing;