Chapter 9½: inside archive/src
lib.rs, in order: Ask, the messages in; Record, Pot and Called,
the reply to a call; Answer and Detail, what is kept of Jev's answer,
with note, spread and line to print it; stored, which reads old
answers too; Entry, Stats, Home, FEED and MOST, the feed;
Fetch and Live; Told, the messages out; Admin, Answered and
reads_only, the admin door; and when.
event.rs is an Event: everything a request says about itself, what
kind of client sent it, and whether it is a visit. COLUMNS and values
are the shape of the archive's events table.
tests.rs sends every message through JSON and back (they cross between a
Worker and an object that may be on different code for a few seconds after
a deploy) and checks the printed lines.
Try it.
cargo test -p archive.
| File | What |
|---|---|
| lib.rs | The messages to and from the archive object, and what is kept of an answer. |
| event.rs | Event and Origin: a request kept whole, and its columns. |
| tests.rs | Round trips, printed lines, and old answers still read. |
← Previous: Chapter 9, archive/ · Up: archive · Next: Chapter 10, budget/ →