pub struct DelegateMessage {
pub target: DelegateKey,
pub sender: DelegateKey,
pub payload: Vec<u8>,
pub context: DelegateContext,
pub processed: bool,
}Expand description
A message sent from one delegate to another.
Delegates can communicate with each other by emitting
OutboundDelegateMsg::SendDelegateMessage with a DelegateMessage targeting
another delegate. The runtime delivers it as InboundDelegateMsg::DelegateMessage
to the target delegate’s process() function.
The sender field is overwritten by the runtime with the actual sender’s key
(sender attestation), so delegates cannot spoof their identity.
Fields§
§target: DelegateKeyThe delegate to deliver this message to.
sender: DelegateKeyThe delegate that sent this message (overwritten by runtime for attestation).
payload: Vec<u8>Arbitrary message payload.
context: DelegateContextDelegate context, carried through the processing pipeline.
processed: boolRuntime protocol flag indicating whether this message has been delivered.
Implementations§
Source§impl DelegateMessage
impl DelegateMessage
pub fn new(target: DelegateKey, sender: DelegateKey, payload: Vec<u8>) -> Self
Trait Implementations§
Source§impl Clone for DelegateMessage
impl Clone for DelegateMessage
Source§fn clone(&self) -> DelegateMessage
fn clone(&self) -> DelegateMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DelegateMessage
impl Debug for DelegateMessage
Source§impl<'de> Deserialize<'de> for DelegateMessage
impl<'de> Deserialize<'de> for DelegateMessage
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<DelegateMessage> for OutboundDelegateMsg
impl From<DelegateMessage> for OutboundDelegateMsg
Source§fn from(msg: DelegateMessage) -> Self
fn from(msg: DelegateMessage) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DelegateMessage
impl RefUnwindSafe for DelegateMessage
impl Send for DelegateMessage
impl Sync for DelegateMessage
impl Unpin for DelegateMessage
impl UnsafeUnpin for DelegateMessage
impl UnwindSafe for DelegateMessage
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
Mutably borrows from an owned value. Read more