pub struct Pdu {
pub event_id: OwnedEventId,
pub room_id: OwnedRoomId,
pub sender: OwnedUserId,
pub origin_server_ts: MilliSecondsSinceUnixEpoch,
pub kind: TimelineEventType,
pub content: Box<RawValue>,
pub state_key: Option<String>,
pub prev_events: Vec<OwnedEventId>,
pub auth_events: Vec<OwnedEventId>,
pub depth: u64,
pub redacts: Option<OwnedEventId>,
pub rejected: bool,
}Expand description
A persistent data unit with the fields state resolution and the auth rules read.
Fields§
§event_id: OwnedEventId§room_id: OwnedRoomId§sender: OwnedUserId§origin_server_ts: MilliSecondsSinceUnixEpoch§kind: TimelineEventType§content: Box<RawValue>§state_key: Option<String>§prev_events: Vec<OwnedEventId>§auth_events: Vec<OwnedEventId>§depth: u64§redacts: Option<OwnedEventId>§rejected: boolImplementations§
Source§impl Pdu
impl Pdu
Sourcepub fn from_wire(
event_id: OwnedEventId,
obj: &CanonicalJsonObject,
) -> Result<Self, String>
pub fn from_wire( event_id: OwnedEventId, obj: &CanonicalJsonObject, ) -> Result<Self, String>
Reads a wire-format PDU (no event_id inside; the caller computed it).
Trait Implementations§
Source§impl Event for Pdu
impl Event for Pdu
Source§type Id = OwnedEventId
type Id = OwnedEventId
The type used to represent the ID of an event.
Source§fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
The time of creation on the originating server.
Source§fn event_type(&self) -> &TimelineEventType
fn event_type(&self) -> &TimelineEventType
The event type.
Source§fn prev_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>
fn prev_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>
The events before this event.
Source§fn auth_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>
fn auth_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>
All the authenticating events for this event.
Auto Trait Implementations§
impl Freeze for Pdu
impl RefUnwindSafe for Pdu
impl Send for Pdu
impl Sync for Pdu
impl Unpin for Pdu
impl UnsafeUnpin for Pdu
impl UnwindSafe for Pdu
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more