Expand description
Vocabulary exchange between two KUTE peers (development directive v0.2, R9). Before one side sends encoded data, both must hold the same vocabulary, identified by its content digest. The protocol lets them find out, transfer the vocabulary if needed, extend it together, and check that what was sent is what was decoded.
Peer is the state machine: it takes a message and returns replies,
and does no I/O. Session drives the initiating side over a
Transport. Framed is a transport over any byte stream.
There is no encryption and no authentication here. A peer treats everything it receives as untrusted: vocabularies are validated and their digests recomputed, sizes are bounded before allocation, and decoding is bounded before output is produced.
Modules§
- tls
- Authenticated, encrypted transport for the exchange protocol: TLS 1.3
with a certificate on both sides (mutual TLS), through
rustls.
Structs§
- Delivered
- A message this peer received and decoded.
- Framed
- Messages over a byte stream: a four-byte little-endian length, then that many bytes of JSON.
- Peer
- One side of the protocol.
- Policy
- What a peer is willing to do for the other side.
- Remote
- The other side’s answer to
CAPABILITIES. - Session
- A peer together with its connection.
- Vocab
Ref - What identifies a vocabulary to the other side.
Enums§
Constants§
- DEFAULT_
MAX_ FRAME - Default and largest frame a peer will read.
- EVOLUTION_
RULE - The rule by which this build derives an evolved vocabulary. Two peers that name different rules would derive different children from the same proposal, so a proposal is only taken under this exact name.
- PROTOCOL_
VERSION - Version 2 added the evolution rule to
CAPABILITIESand toSYMBOL_PROPOSE, theUNSUPPORTED_RULEandBUSYerrors, and the delivery contract for repeated message ids. A version 1 peer is refused atHELLO.
Traits§
- Transport
- Something that carries messages to the other peer and back.
Functions§
Type Aliases§
- Vocabulary
Check - A test a vocabulary must pass before it is taken from the other side.
It is given the vocabulary after its digest has been recomputed and
matched; an
Erris the reason it is refused. The protocol does no cryptography of its own: a caller that wants signatures checks them here.