pub struct MessagePayload {
pub transaction: Transaction,
pub relay: MessageRelay,
pub verification: MessageVerification,
}Expand description
MessagePayload is used to transmit data between nodes.
The data should be packed by Transaction.
Fields§
§transaction: TransactionPayload data
relay: MessageRelayThe relay carrier: the next hop, the destination, and the forwards left.
verification: MessageVerificationThis field holds a signature from a node, which is used to prove that payload was created by that node.
Implementations§
Source§impl MessagePayload
impl MessagePayload
Sourcepub fn new(
transaction: Transaction,
signer: MessageSigner<impl Borrow<DelegateeKey>>,
relay: MessageRelay,
) -> Result<MessagePayload, Error>
pub fn new( transaction: Transaction, signer: MessageSigner<impl Borrow<DelegateeKey>>, relay: MessageRelay, ) -> Result<MessagePayload, Error>
Create new MessagePayload.
Need Transaction, MessageSigner and MessageRelay.
Sourcepub fn new_send_with_sequence<T>(
data: T,
signer: MessageSigner<impl Borrow<DelegateeKey>>,
hop: NextHop,
destination: Did,
sequence: u64,
reply_via: Option<Did>,
) -> Result<MessagePayload, Error>where
T: Serialize,
pub fn new_send_with_sequence<T>(
data: T,
signer: MessageSigner<impl Borrow<DelegateeKey>>,
hop: NextHop,
destination: Did,
sequence: u64,
reply_via: Option<Did>,
) -> Result<MessagePayload, Error>where
T: Serialize,
A locally originated payload: a fresh carrier with the full hop budget leaving along
the delivery decision hop, over a transaction that names reply_via.
Sourcepub fn from_wire(data: &[u8]) -> Result<MessagePayload, Error>
pub fn from_wire(data: &[u8]) -> Result<MessagePayload, Error>
Deserializes a self-contained MessagePayload from the Rings wire encoding: a payload
frame with both sessions inline.
A frame that references a session is meaningful only on the link that carried it inline,
and is refused here with Error::DelegationReferenceUnresolved; a link resolves such
frames before they reach a MessagePayload.
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 Decoder for MessagePayload
impl Decoder for MessagePayload
Source§fn from_encoded(encoded: &Encoded) -> Result<MessagePayload, Error>
fn from_encoded(encoded: &Encoded) -> Result<MessagePayload, Error>
Self from an Encoded wrapper.Source§impl<'de> Deserialize<'de> for MessagePayload
impl<'de> Deserialize<'de> for MessagePayload
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessagePayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessagePayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Encoder for MessagePayload
impl Encoder for MessagePayload
impl Eq for MessagePayload
Source§impl MessageVerificationExt for MessagePayload
impl MessageVerificationExt for MessagePayload
Source§const DOMAIN_TAG: DomainTag = PAYLOAD_DOMAIN_TAG
const DOMAIN_TAG: DomainTag = PAYLOAD_DOMAIN_TAG
SigningDomain of Self::verification.Source§fn verification(&self) -> &MessageVerification
fn verification(&self) -> &MessageVerification
Source§fn is_expired(&self) -> bool
fn is_expired(&self) -> bool
Source§fn verify_at(&self, network_id: u32, at_ms: u128) -> bool
fn verify_at(&self, network_id: u32, at_ms: u128) -> bool
at_ms: its proof was live then, its session was
authorized and live then, and the signature was issued for this message family inside
the overlay network_id. Read moreSource§impl PartialEq for MessagePayload
impl PartialEq for MessagePayload
Source§impl Serialize for MessagePayload
impl Serialize for MessagePayload
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for MessagePayload
Auto Trait Implementations§
impl Forget for MessagePayload
impl Freeze for MessagePayload
impl Move 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<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for T
impl<T> MaybeSendSync for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.