Struct matrix_sdk_base::store::StateChanges
source · 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, MinimalRoomMemberEvent>>,
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, BTreeMap<String, 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, MinimalRoomMemberEvent>>
A mapping of RoomId
to a map of users and their
MinimalRoomMemberEvent
.
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 RoomId
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, BTreeMap<String, 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) -> Self
pub fn new(sync_token: String) -> Self
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_account_data(
&mut self,
event: AnyGlobalAccountDataEvent,
raw_event: Raw<AnyGlobalAccountDataEvent>
)
pub fn add_account_data( &mut self, event: AnyGlobalAccountDataEvent, raw_event: Raw<AnyGlobalAccountDataEvent> )
Update the StateChanges
struct with the given AnyBasicEvent
.
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<StrippedRoomMemberEvent>
)
pub fn add_stripped_member( &mut self, room_id: &RoomId, user_id: &UserId, event: Raw<StrippedRoomMemberEvent> )
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 more