From 9b4d9b4feb99a5ec77a608dddec5999326abf8fa Mon Sep 17 00:00:00 2001 From: n1c00o Date: Fri, 1 Oct 2021 17:15:47 +0200 Subject: [PATCH] Start doing structs for NATS --- common/rust/src/payloads.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/common/rust/src/payloads.rs b/common/rust/src/payloads.rs index 6eb35c8..5c12c7a 100644 --- a/common/rust/src/payloads.rs +++ b/common/rust/src/payloads.rs @@ -3,13 +3,23 @@ use serde::{Deserialize, Serialize}; /// Payload send to the nova cache queues #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(bound(deserialize = "T: Deserialize<'de> + std::default::Default + Clone"))] -pub struct CachePayload { +pub struct CachePayload { pub tracing: Tracing, - pub data: T + pub data: CacheData, } #[derive(Serialize, Deserialize, Debug, Clone)] pub struct Tracing { pub node_id: String, - pub span: Option -} \ No newline at end of file + pub span: Option, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub enum CacheData { + Ready {}, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct ReadyCacheData { + pub version: u8, +} -- 2.39.5