pub enum MessagePayload {
Show 16 variants
Block(Block),
BlockRequest(Hash),
BlockResponse(Option<Block>),
Transaction(SignedTransaction),
TransactionRequest(Hash),
TransactionResponse(Option<SignedTransaction>),
Attestation(AttestationMessage),
InferenceRequest(InferenceRequestMessage),
InferenceResponse(InferenceResponseMessage),
ModelRegistration(ModelRegistrationMessage),
AgentAnnouncement(AgentAnnouncementMessage),
ProviderAnnouncement(ProviderAnnouncementMessage),
Status(StatusMessage),
Ping,
Pong,
Custom {
topic: String,
data: Vec<u8>,
},
}Expand description
Message payload types.
Uses serde’s default externally-tagged enum representation
({"Variant": payload} in JSON, u32 discriminant + payload in bincode).
Adjacently/internally tagged forms (#[serde(tag = "...", content = "...")])
route through serialize_struct/deserialize_identifier, which bincode 1.x
does not support — receivers reject every gossip message with
“Bincode does not support Deserializer::deserialize_identifier”, stalling
consensus. See bincode-org/bincode#272 and #548.
Variants§
Block(Block)
New block announcement
BlockRequest(Hash)
Block request by hash
BlockResponse(Option<Block>)
Block response
Transaction(SignedTransaction)
Transaction broadcast
TransactionRequest(Hash)
Transaction request
TransactionResponse(Option<SignedTransaction>)
Transaction response
Attestation(AttestationMessage)
TEE attestation
InferenceRequest(InferenceRequestMessage)
Model inference request
InferenceResponse(InferenceResponseMessage)
Model inference response
ModelRegistration(ModelRegistrationMessage)
Model registration
AgentAnnouncement(AgentAnnouncementMessage)
Agent announcement — broadcast by nodes that have registered agents so all peers can populate their network_agents cache.
ProviderAnnouncement(ProviderAnnouncementMessage)
Provider announcement — broadcast by nodes serving models/TEE so all peers can populate their network_providers cache.
Status(StatusMessage)
Peer status update
Ping
Ping message
Pong
Pong response
Custom
Custom application message
Implementations§
Trait Implementations§
Source§impl Clone for MessagePayload
impl Clone for MessagePayload
Source§fn clone(&self) -> MessagePayload
fn clone(&self) -> MessagePayload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessagePayload
impl Debug for MessagePayload
Source§impl<'de> Deserialize<'de> for MessagePayload
impl<'de> Deserialize<'de> for MessagePayload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MessagePayload
impl RefUnwindSafe for MessagePayload
impl Send for MessagePayload
impl Sync for MessagePayload
impl Unpin for MessagePayload
impl UnsafeUnpin for MessagePayload
impl UnwindSafe for MessagePayload
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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