replayer-mx

git clone git://archive.git.mtrnord.blog/MTRNord/replayer-mx.git
Log | Files | Refs

mod.rs (738B)


      1 pub(crate) mod common;
      2 pub(crate) mod message;
      3 
      4 use std::borrow::Cow;
      5 
      6 use minicbor::{Decode, Encode};
      7 
      8 use crate::events::{common::Unsigned, message::RoomMessageContent};
      9 
     10 #[derive(Encode, Decode, Debug)]
     11 pub(crate) struct Event<'a> {
     12     #[b(0)]
     13     pub(crate) content: Content<'a>,
     14     #[b(1)]
     15     pub(crate) room_id: Cow<'a, str>,
     16     #[b(2)]
     17     pub(crate) event_id: Cow<'a, str>,
     18     #[b(3)]
     19     pub(crate) sender: Cow<'a, str>,
     20     #[b(4)]
     21     pub(crate) origin_server_ts: u64,
     22     #[b(5)]
     23     pub(crate) unsigned: Unsigned<'a, Content<'a>>,
     24     #[b(6)]
     25     pub(crate) state_key: Option<Cow<'a, str>>,
     26 }
     27 
     28 #[derive(Encode, Decode, Debug)]
     29 pub(crate) enum Content<'a> {
     30     #[b(0)]
     31     RoomMessage(#[b(0)] RoomMessageContent<'a>),
     32 }