refactor: Rename PduBuilder to PartialPdu

This commit is contained in:
Ginger
2026-04-10 11:47:01 -04:00
parent bf9c9716eb
commit 97a01a1500
27 changed files with 95 additions and 95 deletions
+1 -1
View File
@@ -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};
+2 -2
View File
@@ -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(),