relay_core/envelope/
meta.rs1use semver::Version;
2use serde::{Deserialize, Serialize};
3use time::OffsetDateTime;
4use uuid::Uuid;
5
6use crate::{
7 prelude::{Address, CryptoMeta},
8 signed::Signed,
9};
10
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct MetaEnvelope {
13 pub gid: Uuid,
14 pub version: Version,
15 pub from: Address,
16 pub to: Address,
17 #[serde(with = "time::serde::rfc3339")]
18 pub timestamp: OffsetDateTime,
19 pub crypto: CryptoMeta,
20 pub payload: Signed,
22}
23
24impl From<MetaEnvelope> for MetaPayload {
25 fn from(val: MetaEnvelope) -> MetaPayload {
26 MetaPayload {
27 gid: val.gid,
28 version: val.version,
29 from: val.from,
30 to: val.to,
31 timestamp: val.timestamp,
32 }
33 }
34}
35
36#[derive(Debug, Clone, Serialize, Deserialize)]
37pub struct MetaPayload {
38 pub gid: Uuid,
39 pub version: Version,
40 pub from: Address,
41 pub to: Address,
42 #[serde(with = "time::serde::rfc3339")]
43 pub timestamp: OffsetDateTime,
44}