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 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, MinimalRoomMemberEvent>>
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) -> 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_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 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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