pub enum PayloadKind {
Vault,
Request,
}Expand description
What a payload asks the peer to do.
Separate from the vault record kind, which describes one record inside a payload
(entry or tombstone); this one describes the payload as a whole.
It takes part in the outer AAD and is therefore authenticated. The kind decides whether the receiver sends a payload back, and an unauthenticated one could be changed by a third party into a request that makes the receiver send its entire vault.
Variants§
Vault
The sender’s full state: accept it and merge.
Request
The sender’s request: send me your full state.
A request carries no records: “what I want” is a set, and in real use that set
is “everything”. The receiver answers with Payload::from_vault. Incremental sync
will add a list of wanted IDs here rather than introduce a different format — the same
convention described on Payload::from_vault.
It is a distinct variant rather than “an empty payload means a request”: a freshly registered device with no entries yet sends a full sync whose payload is also empty.