pub enum MessagePayload<'a> {
BlobShare {
chunk: Cow<'a, [u8]>,
},
KeyShare {
sender_key: PrivateKey,
},
DeltaResponse {
delta: Cow<'a, [u8]>,
},
DeltaNotFound,
DagHeadsResponse {
dag_heads: Vec<[u8; 32]>,
root_hash: Hash,
},
Challenge {
challenge: [u8; 32],
},
ChallengeResponse {
signature: [u8; 64],
},
SnapshotBoundaryResponse {
boundary_timestamp: u64,
boundary_root_hash: Hash,
dag_heads: Vec<[u8; 32]>,
},
SnapshotPage {
payload: Cow<'a, [u8]>,
uncompressed_len: u32,
cursor: Option<Vec<u8>>,
page_count: u64,
sent_count: u64,
},
SnapshotError {
error: SnapshotError,
},
TreeNodeResponse {
nodes: Vec<TreeNode>,
not_found: bool,
},
LevelWiseResponse {
level: u32,
nodes: Vec<LevelNode>,
has_more_levels: bool,
},
}Expand description
Response and follow-up message payloads.
Each variant represents a different type of response or continuation message in a sync protocol exchange.
Variants§
Blob data chunk.
Encryption key share.
DeltaResponse
Response to DeltaRequest containing the requested delta.
DeltaNotFound
Delta not found response.
DagHeadsResponse
Response to DagHeadsRequest containing peer’s current heads and root hash.
Challenge
Challenge to prove ownership of claimed identity.
ChallengeResponse
Response to challenge with signature (Ed25519 signature is 64 bytes).
SnapshotBoundaryResponse
Response to SnapshotBoundaryRequest.
Fields
SnapshotPage
A page of snapshot data.
Fields
SnapshotError
Snapshot sync error.
Fields
error: SnapshotErrorThe error that occurred.
TreeNodeResponse
Response to TreeNodeRequest for HashComparison sync (CIP §4).
Contains tree nodes from the requested subtree for Merkle comparison.
Fields
LevelWiseResponse
Response to LevelWiseRequest for LevelWise sync (CIP Appendix B).
Contains all nodes at the requested level for breadth-first comparison.
Trait Implementations§
Source§impl<'a> BorshDeserialize for MessagePayload<'a>
impl<'a> BorshDeserialize for MessagePayload<'a>
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl<'a> BorshSerialize for MessagePayload<'a>
impl<'a> BorshSerialize for MessagePayload<'a>
Source§impl<'a> Debug for MessagePayload<'a>
impl<'a> Debug for MessagePayload<'a>
Auto Trait Implementations§
impl<'a> Freeze for MessagePayload<'a>
impl<'a> RefUnwindSafe for MessagePayload<'a>
impl<'a> Send for MessagePayload<'a>
impl<'a> Sync for MessagePayload<'a>
impl<'a> Unpin for MessagePayload<'a>
impl<'a> UnsafeUnpin for MessagePayload<'a>
impl<'a> UnwindSafe for MessagePayload<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more