Struct matrix_sdk_base::store::StateChanges
source · [−]pub struct StateChanges {Show 15 fields
pub sync_token: Option<String>,
pub session: Option<Session>,
pub account_data: BTreeMap<GlobalAccountDataEventType, Raw<AnyGlobalAccountDataEvent>>,
pub presence: BTreeMap<OwnedUserId, Raw<PresenceEvent>>,
pub members: BTreeMap<OwnedRoomId, BTreeMap<OwnedUserId, SyncRoomMemberEvent>>,
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 stripped_state: BTreeMap<OwnedRoomId, BTreeMap<StateEventType, BTreeMap<String, Raw<AnyStrippedStateEvent>>>>,
pub stripped_members: BTreeMap<OwnedRoomId, BTreeMap<OwnedUserId, StrippedRoomMemberEvent>>,
pub stripped_room_infos: BTreeMap<OwnedRoomId, RoomInfo>,
pub ambiguity_maps: BTreeMap<OwnedRoomId, BTreeMap<String, BTreeSet<OwnedUserId>>>,
pub notifications: BTreeMap<OwnedRoomId, Vec<Notification>>,
}Expand description
Store state changes and pass them to the StateStore.
Fields
sync_token: Option<String>The sync token that relates to this update.
session: Option<Session>A user session, containing an access token and information about the associated user account.
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.
members: BTreeMap<OwnedRoomId, BTreeMap<OwnedUserId, SyncRoomMemberEvent>>A mapping of RoomId to a map of users and their SyncRoomMemberEvent.
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.
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.
stripped_members: BTreeMap<OwnedRoomId, BTreeMap<OwnedUserId, StrippedRoomMemberEvent>>A mapping of RoomId to a map of users and their
StrippedRoomMemberEvent.
stripped_room_infos: BTreeMap<OwnedRoomId, RoomInfo>A map of RoomId to RoomInfo for stripped rooms (e.g. for invites or
while knocking)
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.
notifications: BTreeMap<OwnedRoomId, Vec<Notification>>A map of RoomId to a vector of Notifications
Implementations
sourceimpl 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_stripped_room(&mut self, room: RoomInfo)
pub fn add_stripped_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,
event: StrippedRoomMemberEvent
)
pub fn add_stripped_member(
&mut self,
room_id: &RoomId,
event: 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_notification(&mut self, room_id: &RoomId, notification: Notification)
pub fn add_notification(&mut self, room_id: &RoomId, notification: Notification)
Update the StateChanges struct with the given room with a new
Notification.
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
sourceimpl Debug for StateChanges
impl Debug for StateChanges
sourceimpl Default for StateChanges
impl Default for StateChanges
sourcefn default() -> StateChanges
fn default() -> StateChanges
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for StateChanges
impl Send for StateChanges
impl Sync for StateChanges
impl Unpin for StateChanges
impl UnwindSafe for StateChanges
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more