pub struct StateChanges {
pub sync_token: Option<String>,
pub account_data: BTreeMap<GlobalAccountDataEventType, Raw<AnyGlobalAccountDataEvent>>,
pub presence: BTreeMap<OwnedUserId, Raw<PresenceEvent>>,
pub profiles: BTreeMap<OwnedRoomId, BTreeMap<OwnedUserId, MinimalStateEvent<RoomMemberEventContent>>>,
pub profiles_to_delete: BTreeMap<OwnedRoomId, Vec<OwnedUserId>>,
pub state: BTreeMap<OwnedRoomId, BTreeMap<StateEventType, BTreeMap<String, Raw<AnySyncStateEvent>>>>,
pub room_account_data: BTreeMap<OwnedRoomId, BTreeMap<RoomAccountDataEventType, Raw<AnyRoomAccountDataEvent>>>,
pub room_infos: BTreeMap<OwnedRoomId, RoomInfo>,
pub receipts: BTreeMap<OwnedRoomId, ReceiptEventContent>,
pub redactions: BTreeMap<OwnedRoomId, BTreeMap<OwnedEventId, Raw<SyncRoomRedactionEvent>>>,
pub stripped_state: BTreeMap<OwnedRoomId, BTreeMap<StateEventType, BTreeMap<String, Raw<AnyStrippedStateEvent>>>>,
pub ambiguity_maps: BTreeMap<OwnedRoomId, HashMap<DisplayName, BTreeSet<OwnedUserId>>>,
}
Expand description
Store state changes and pass them to the StateStore.
Fields§
§sync_token: Option<String>
The sync token that relates to this update.
account_data: BTreeMap<GlobalAccountDataEventType, Raw<AnyGlobalAccountDataEvent>>
A mapping of event type string to AnyBasicEvent
.
presence: BTreeMap<OwnedUserId, Raw<PresenceEvent>>
A mapping of UserId
to PresenceEvent
.
profiles: BTreeMap<OwnedRoomId, BTreeMap<OwnedUserId, MinimalStateEvent<RoomMemberEventContent>>>
A mapping of RoomId
to a map of users and their
MinimalRoomMemberEvent
.
profiles_to_delete: BTreeMap<OwnedRoomId, Vec<OwnedUserId>>
A mapping of room profiles to delete.
These are deleted before other room profiles are inserted.
state: BTreeMap<OwnedRoomId, BTreeMap<StateEventType, BTreeMap<String, Raw<AnySyncStateEvent>>>>
A mapping of RoomId
to a map of event type string to a state key and
AnySyncStateEvent
.
room_account_data: BTreeMap<OwnedRoomId, BTreeMap<RoomAccountDataEventType, Raw<AnyRoomAccountDataEvent>>>
A mapping of RoomId
to a map of event type string to AnyBasicEvent
.
room_infos: BTreeMap<OwnedRoomId, RoomInfo>
A map of OwnedRoomId
to RoomInfo
.
receipts: BTreeMap<OwnedRoomId, ReceiptEventContent>
A map of RoomId
to ReceiptEventContent
.
redactions: BTreeMap<OwnedRoomId, BTreeMap<OwnedEventId, Raw<SyncRoomRedactionEvent>>>
A map of RoomId
to maps of OwnedEventId
to be redacted by
SyncRoomRedactionEvent
.
stripped_state: BTreeMap<OwnedRoomId, BTreeMap<StateEventType, BTreeMap<String, Raw<AnyStrippedStateEvent>>>>
A mapping of RoomId
to a map of event type to a map of state key to
AnyStrippedStateEvent
.
ambiguity_maps: BTreeMap<OwnedRoomId, HashMap<DisplayName, BTreeSet<OwnedUserId>>>
A map from room id to a map of a display name and a set of user ids that share that display name in the given room.
Implementations§
Source§impl StateChanges
impl StateChanges
Sourcepub fn new(sync_token: String) -> StateChanges
pub fn new(sync_token: String) -> StateChanges
Create a new StateChanges
struct with the given sync_token.
Sourcepub fn add_presence_event(
&mut self,
event: PresenceEvent,
raw_event: Raw<PresenceEvent>,
)
pub fn add_presence_event( &mut self, event: PresenceEvent, raw_event: Raw<PresenceEvent>, )
Update the StateChanges
struct with the given PresenceEvent
.
Sourcepub fn add_room(&mut self, room: RoomInfo)
pub fn add_room(&mut self, room: RoomInfo)
Update the StateChanges
struct with the given RoomInfo
.
Sourcepub fn add_room_account_data(
&mut self,
room_id: &RoomId,
event: AnyRoomAccountDataEvent,
raw_event: Raw<AnyRoomAccountDataEvent>,
)
pub fn add_room_account_data( &mut self, room_id: &RoomId, event: AnyRoomAccountDataEvent, raw_event: Raw<AnyRoomAccountDataEvent>, )
Update the StateChanges
struct with the given room with a new
AnyBasicEvent
.
Sourcepub fn add_stripped_member(
&mut self,
room_id: &RoomId,
user_id: &UserId,
event: Raw<StrippedStateEvent<RoomMemberEventContent>>,
)
pub fn add_stripped_member( &mut self, room_id: &RoomId, user_id: &UserId, event: Raw<StrippedStateEvent<RoomMemberEventContent>>, )
Update the StateChanges
struct with the given room with a new
StrippedMemberEvent
.
Sourcepub fn add_state_event(
&mut self,
room_id: &RoomId,
event: AnySyncStateEvent,
raw_event: Raw<AnySyncStateEvent>,
)
pub fn add_state_event( &mut self, room_id: &RoomId, event: AnySyncStateEvent, raw_event: Raw<AnySyncStateEvent>, )
Update the StateChanges
struct with the given room with a new
AnySyncStateEvent
.
Sourcepub fn add_redaction(
&mut self,
room_id: &RoomId,
redacted_event_id: &EventId,
redaction: Raw<SyncRoomRedactionEvent>,
)
pub fn add_redaction( &mut self, room_id: &RoomId, redacted_event_id: &EventId, redaction: Raw<SyncRoomRedactionEvent>, )
Redact an event in the room
Sourcepub fn add_receipts(&mut self, room_id: &RoomId, event: ReceiptEventContent)
pub fn add_receipts(&mut self, room_id: &RoomId, event: ReceiptEventContent)
Update the StateChanges
struct with the given room with a new
Receipts
.
Trait Implementations§
Source§impl Clone for StateChanges
impl Clone for StateChanges
Source§fn clone(&self) -> StateChanges
fn clone(&self) -> StateChanges
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for StateChanges
impl Debug for StateChanges
Source§impl Default for StateChanges
impl Default for StateChanges
Source§fn default() -> StateChanges
fn default() -> StateChanges
Auto Trait Implementations§
impl Freeze for StateChanges
impl RefUnwindSafe for StateChanges
impl Send for StateChanges
impl Sync for StateChanges
impl Unpin for StateChanges
impl UnwindSafe for StateChanges
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more