mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
refactor: Rename PduBuilder to PartialPdu
This commit is contained in:
@@ -7,6 +7,6 @@ pub mod state_res;
|
||||
pub mod versions;
|
||||
|
||||
pub use event::{Event, TypeExt as EventTypeExt};
|
||||
pub use pdu::{Pdu, PduBuilder, PduCount, PduEvent, PduId, RawPduId, ShortId};
|
||||
pub use pdu::{PartialPdu, Pdu, PduCount, PduEvent, PduId, RawPduId, ShortId};
|
||||
pub use state_key::StateKey;
|
||||
pub use state_res::{StateMap, TypeStateKey};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
mod builder;
|
||||
mod count;
|
||||
mod id;
|
||||
mod partial;
|
||||
mod raw_id;
|
||||
mod redact;
|
||||
#[cfg(test)]
|
||||
@@ -18,9 +18,9 @@ use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
pub use self::{
|
||||
Count as PduCount, Id as PduId, Pdu as PduEvent, RawId as RawPduId,
|
||||
builder::{Builder, Builder as PduBuilder},
|
||||
count::Count,
|
||||
id::{ShortId, *},
|
||||
partial::PartialPdu,
|
||||
raw_id::*,
|
||||
};
|
||||
use super::{Event, StateKey};
|
||||
|
||||
@@ -9,9 +9,9 @@ use serde_json::value::{RawValue as RawJsonValue, to_raw_value};
|
||||
|
||||
use super::StateKey;
|
||||
|
||||
/// Build the start of a PDU in order to add it to the Database.
|
||||
/// An event and its associated metadata, without an ID, signatures, or hashes.
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Builder {
|
||||
pub struct PartialPdu {
|
||||
#[serde(rename = "type")]
|
||||
pub event_type: TimelineEventType,
|
||||
|
||||
@@ -30,7 +30,7 @@ pub struct Builder {
|
||||
|
||||
type Unsigned = BTreeMap<String, serde_json::Value>;
|
||||
|
||||
impl Builder {
|
||||
impl PartialPdu {
|
||||
pub fn state<S, T>(state_key: S, content: &T) -> Self
|
||||
where
|
||||
T: StateEventContent,
|
||||
@@ -58,7 +58,7 @@ impl Builder {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Builder {
|
||||
impl Default for PartialPdu {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
event_type: "m.room.message".into(),
|
||||
Reference in New Issue
Block a user