enigma_protocol/
types.rs

1pub use enigma_packet::AttachmentKind;
2use enigma_packet::Message;
3use uuid::Uuid;
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq)]
6pub enum InitiatorOrResponder {
7    Initiator,
8    Responder,
9}
10
11#[derive(Debug, Clone, Copy, PartialEq, Eq)]
12pub enum SessionBootstrap {
13    PreSharedSecret {
14        secret32: [u8; 32],
15        role: InitiatorOrResponder,
16        remote_dh_pub: Option<[u8; 32]>,
17    },
18}
19
20#[derive(Debug, Clone)]
21pub enum ClientEvent {
22    MessageReceived {
23        from: String,
24        message: Message,
25    },
26    AttachmentProgress {
27        from: String,
28        attachment_id: Uuid,
29        received_chunks: u32,
30        total_chunks: u32,
31    },
32    AttachmentCompleted {
33        from: String,
34        attachment_id: Uuid,
35        total_size: u64,
36    },
37}