Turn append_pdu args into struct PduBuilder
This commit is contained in:
parent
1c6f211933
commit
d948f896c0
4 changed files with 322 additions and 260 deletions
12
src/pdu.rs
12
src/pdu.rs
|
@ -175,3 +175,15 @@ impl PduEvent {
|
|||
serde_json::from_value(json).expect("Raw::from_value always works")
|
||||
}
|
||||
}
|
||||
|
||||
/// Build the start of a PDU in order to add it to the `Database`.
|
||||
#[derive(Debug)]
|
||||
pub struct PduBuilder {
|
||||
pub room_id: RoomId,
|
||||
pub sender: UserId,
|
||||
pub event_type: EventType,
|
||||
pub content: serde_json::Value,
|
||||
pub unsigned: Option<serde_json::Map<String, serde_json::Value>>,
|
||||
pub state_key: Option<String>,
|
||||
pub redacts: Option<EventId>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue