1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use std::collections::BTreeMap;
use js_int::UInt;
use ruma_common::MilliSecondsSinceUnixEpoch;
use ruma_events::{pdu::EventHash, EventType};
use ruma_identifiers::{EventId, RoomId, ServerName, ServerSigningKeyId, UserId};
use serde_json::value::Value as JsonValue;
pub trait Event {
fn event_id(&self) -> &EventId;
fn room_id(&self) -> &RoomId;
fn sender(&self) -> &UserId;
fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch;
fn kind(&self) -> EventType;
fn content(&self) -> serde_json::Value;
fn state_key(&self) -> Option<String>;
fn prev_events(&self) -> Vec<EventId>;
fn depth(&self) -> &UInt;
fn auth_events(&self) -> Vec<EventId>;
fn redacts(&self) -> Option<&EventId>;
fn unsigned(&self) -> &BTreeMap<String, JsonValue>;
fn hashes(&self) -> &EventHash;
fn signatures(&self) -> BTreeMap<Box<ServerName>, BTreeMap<ServerSigningKeyId, String>>;
}