Skip to content

Commit

Permalink
Add messaging layer types
Browse files Browse the repository at this point in the history
  • Loading branch information
tbraun96 committed Jun 9, 2024
1 parent 29021aa commit a33b53c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions citadel-internal-service-types/src/messaging_layer.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
use serde::{Deserialize, Serialize};
use crate::InternalServiceResponse;


pub enum MessengerUpdate {
Message { message: CWMessage },
Other { response: InternalServiceResponse },
}

#[derive(Serialize, Deserialize)]
pub enum CWProtocolMessage {
Message { message: CWMessage },
MessageAck { id: u64 },
Poll { ids: Vec<u64> },
PollResponse { messages: Vec<CWMessage> },
}

pub struct OutgoingCWMessage {
pub cid: u64,
pub peer_cid: Option<u64>,
pub contents: Vec<u8>,
}

#[derive(Serialize, Deserialize)]
pub struct CWMessage {
pub id: u64,
pub cid: u64,
pub peer_cid: Option<u64>,
pub contents: Vec<u8>,
}

0 comments on commit a33b53c

Please sign in to comment.