pub enum FromSync<T>where
T: TopicQuery,{
HandshakeSuccess(T),
Data {
header: Vec<u8>,
payload: Option<Vec<u8>>,
},
}Expand description
Messages which can be sent to the higher application layers (for further validation or persistance) and the underlying transport layer (for managing the sync session).
Variants§
HandshakeSuccess(T)
During the “Handshake” phase both peers usually manage access control and negotiate the “topic query” they want to exchange over. This message indicates that this phase has ended.
Implementations for p2panda-net are required to send this message to the underlying
transport layer to inform the “backend” that we’ve successfully requested access, exchanged
the topic query with the remote peer and are about to begin sync.
With this information backends can optionally apply optimisations, which might for example be required to keep application messages in-order (as there might exist other channels the backend exchanges similar data over at the same time).
Data
Application data we’ve received during the sync session from the remote peer and want to forward to higher application layers.
These “frontends” might further process, decrypt payloads, sort messages or apply more validation before they get finally persisted or rendered to the user. At this point the sync protocol is merely “forwarding” it without any knowledge of how the data is used.