Skip to main content

SyncMessage

Enum SyncMessage 

Source
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.

Fields

§node_id: NodeId
§root_page: PageId
§root_hash: MerkleHash
§

HelloAck

Responder acknowledgment with its own tree root state.

Fields

§node_id: NodeId
§root_page: PageId
§root_hash: MerkleHash
§in_sync: bool
§

DigestRequest

Request page digests from the remote tree.

Fields

§page_ids: Vec<PageId>
§

DigestResponse

Response with page digests.

Fields

§digests: Vec<PageDigest>
§

EntriesRequest

Request leaf entries from remote pages.

Fields

§page_ids: Vec<PageId>
§

EntriesResponse

Response with leaf entries.

Fields

§entries: Vec<DiffEntry>
§

PatchData

Serialized SyncPatch data.

Fields

§data: Vec<u8>
§

PatchAck

Acknowledgment after applying a patch.

Fields

§

Done

Session complete.

§

Error

Error during sync.

Fields

§message: String
§

PullRequest

Request updated root info for pull phase after push.

§

PullResponse

Response with updated root info for pull phase.

Fields

§root_page: PageId
§root_hash: MerkleHash
§

TableListRequest

Request list of named tables from the remote peer.

§

TableListResponse

Response with the list of named tables.

Fields

§tables: Vec<TableInfo>
§

TableSyncBegin

Begin syncing a specific named table.

Fields

§table_name: Vec<u8>
§root_page: PageId
§root_hash: MerkleHash
§

TableSyncEnd

End syncing a specific named table.

Fields

§table_name: Vec<u8>

Implementations§

Source§

impl SyncMessage

Source

pub fn serialize(&self) -> Vec<u8>

Serialize to wire format: [msg_type: u8][payload_len: u32 LE][payload].

Source

pub fn deserialize(data: &[u8]) -> Result<Self, ProtocolError>

Deserialize from wire format.

Trait Implementations§

Source§

impl Clone for SyncMessage

Source§

fn clone(&self) -> SyncMessage

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SyncMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V