pub enum MergedRecord {
Entry {
id: EntryId,
entry: Box<Entry>,
},
Tombstone(Box<Tombstone>),
Group {
id: GroupId,
group: Box<Group>,
},
}Expand description
A record received from a peer, together with its identifier.
The identifier lives here rather than in VaultEntry because VaultEntry
deliberately carries no ID: an entry that brought its own identifier would allow two
contradictory identifiers within the same data. Every record in a sync payload must
carry its identifier — it is one of the AEAD associated data items and the key of the
union. Sealing the pair in an enum makes the state “there is an entry but its identity
is unknown” unrepresentable, so merge_into needs no Result to report a
self-contradictory record.
§No Clone
VaultEntry deliberately does not implement Clone (see crate::otp::OtpSecret),
so this enum cannot derive it either. Copying goes through
VaultEntry::duplicate, an explicit entry point: the call site has to spell out
duplicate(), which makes “another copy of key material is made here” visible in
review.
Variants§
Entry
A live entry.
Tombstone(Box<Tombstone>)
A tombstone (deletion record).
Group
A group with its ordering.
The granularity is the whole group: its name, its position and the order of its entries travel as one value, because that is what the user arranged and what the adjudication screen shows side by side.