pub enum SyncMessage {
Show 16 variants
Hello {
node_id: NodeId,
root_page: PageId,
root_hash: MerkleHash,
},
HelloAck {
node_id: NodeId,
root_page: PageId,
root_hash: MerkleHash,
in_sync: bool,
},
DigestRequest {
page_ids: Vec<PageId>,
},
DigestResponse {
digests: Vec<PageDigest>,
},
EntriesRequest {
page_ids: Vec<PageId>,
},
EntriesResponse {
entries: Vec<DiffEntry>,
},
PatchData {
data: Vec<u8>,
},
PatchAck {
result: ApplyResult,
},
Done,
Error {
message: String,
},
PullRequest,
PullResponse {
root_page: PageId,
root_hash: MerkleHash,
},
TableListRequest,
TableListResponse {
tables: Vec<TableInfo>,
},
TableSyncBegin {
table_name: Vec<u8>,
root_page: PageId,
root_hash: MerkleHash,
},
TableSyncEnd {
table_name: Vec<u8>,
},
}Expand description
Sync protocol messages exchanged between initiator and responder.
Variants§
Hello
Initiator greeting with identity and tree root state.
HelloAck
Responder acknowledgment with its own tree root state.
DigestRequest
Request page digests from the remote tree.
DigestResponse
Response with page digests.
Fields
digests: Vec<PageDigest>EntriesRequest
Request leaf entries from remote pages.
EntriesResponse
Response with leaf entries.
PatchData
Serialized SyncPatch data.
PatchAck
Acknowledgment after applying a patch.
Fields
result: ApplyResultDone
Session complete.
Error
Error during sync.
PullRequest
Request updated root info for pull phase after push.
PullResponse
Response with updated root info for pull phase.
TableListRequest
Request list of named tables from the remote peer.
TableListResponse
Response with the list of named tables.
TableSyncBegin
Begin syncing a specific named table.
TableSyncEnd
End syncing a specific named table.
Implementations§
Source§impl SyncMessage
impl SyncMessage
Sourcepub fn serialize(&self) -> Vec<u8> ⓘ
pub fn serialize(&self) -> Vec<u8> ⓘ
Serialize to wire format: [msg_type: u8][payload_len: u32 LE][payload].
Sourcepub fn deserialize(data: &[u8]) -> Result<Self, ProtocolError>
pub fn deserialize(data: &[u8]) -> Result<Self, ProtocolError>
Deserialize from wire format.
Trait Implementations§
Source§impl Clone for SyncMessage
impl Clone for SyncMessage
Source§fn clone(&self) -> SyncMessage
fn clone(&self) -> SyncMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more