pub struct RoomBuilder<'a> { /* private fields */ }Expand description
Builds the timeline of one NEW room, event by event: fills prev_events, depth and the
auth_events the spec selects from the current state, hashes and signs, computes the id, and
refuses an event the auth rules would reject.
Implementations§
Source§impl<'a> RoomBuilder<'a>
impl<'a> RoomBuilder<'a>
pub fn new( room_id: OwnedRoomId, signer: &'a Signer, start_ts_ms: u64, ) -> Result<Self, BuildError>
Sourcepub fn push(
&mut self,
sender: &str,
kind: &str,
state_key: Option<&str>,
content: Value,
) -> Result<&SignedEvent, BuildError>
pub fn push( &mut self, sender: &str, kind: &str, state_key: Option<&str>, content: Value, ) -> Result<&SignedEvent, BuildError>
Appends one event. state_key makes it a state event.
pub fn events(&self) -> &[SignedEvent]
pub fn state(&self) -> &StateMap<OwnedEventId>
pub fn pdus(&self) -> &HashMap<OwnedEventId, Pdu>
pub fn rules(&self) -> &RoomVersionRules
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for RoomBuilder<'a>
impl<'a> !UnwindSafe for RoomBuilder<'a>
impl<'a> Freeze for RoomBuilder<'a>
impl<'a> Send for RoomBuilder<'a>
impl<'a> Sync for RoomBuilder<'a>
impl<'a> Unpin for RoomBuilder<'a>
impl<'a> UnsafeUnpin for RoomBuilder<'a>
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