One file per family of routes. Each route is a type that says, in its Route impl, which capabilities
it needs; the service serves it only for an adapter that has them (see crate::Service::serve).
12use crate::Response; 13 14pub use jev::{Check, Embed, Rerank}; 15pub use journal::Journal; 16pub use messages::Messages; 17pub use pictures::Pictures; 18pub use speak::Speak; 19pub use sync::{ChatSync, HouseholdSync, MemorySync}; 20pub use usage::Usage; 21 22mod sealed { 23 pub trait Sealed {} 24}
A route, or a family of routes that share their work, and what it takes to serve it.
impl<C: HasJudge + HasClock> Route<C> for Check is the whole statement of what /check needs: a
service on an adapter without those capabilities cannot be given the route, so cannot answer it. The
trait is sealed; a route is added to this crate, with its laws in whiskers-conformance and its
capability in whiskers-ports.
The paths this route answers. Routes do not share a path.
35 const PATHS: &'static [&'static str];
Answers a request for one of PATHS, which the service has already found to be a readable POST.
The routes a service has been given: built by [crate::Service::serve], never written out.
The response of the route that answers path, or None if no route given to the service does.
A route given to the service, and the routes given before it.
55pub struct Then<R, Rest>(pub(crate) R, pub(crate) Rest);
Why a body did not parse, without a word of it: serde's own message quotes the offending value
(invalid type: string "..."), and a body here is what a child said or what Whiskers remembers.