pub struct SyncData {
pub global_account_data_events: Vec<SyncGlobalAccountDataEvent>,
pub room_account_data_events: Vec<SyncRoomAccountDataEvent>,
pub room_events: Vec<SyncEvent>,
pub todevice_events: Vec<SyncToDeviceEvent>,
pub changed_user_keys: Vec<ChangedUserKeys>,
pub left_user_keys: Vec<OwnedUserId>,
pub read_receipts: SyncRoomReceipts,
pub federated_invites: Vec<(StreamId, FederatedInvite)>,
pub federated_knocks: Vec<(StreamId, FederatedInvite)>,
}Expand description
This structure contains any data that needs to be synchronized.
Fields§
§global_account_data_events: Vec<SyncGlobalAccountDataEvent>The global account data that needs to be synchronized.
room_account_data_events: Vec<SyncRoomAccountDataEvent>The rooms account data events that needs to be synchronized.
room_events: Vec<SyncEvent>The room events that need to be synchronized.
todevice_events: Vec<SyncToDeviceEvent>The to-device events that needs to be synchronized.
changed_user_keys: Vec<ChangedUserKeys>The list of users who either changed their keys or newly joined a room shared with the synchronizing user.
left_user_keys: Vec<OwnedUserId>The list of users who either changed their keys or newly joined a room shared with the synchronizing user.
read_receipts: SyncRoomReceiptsThe new and forward read receipts that were received since the last sync.
federated_invites: Vec<(StreamId, FederatedInvite)>The invites the syncing user has received over federation
federated_knocks: Vec<(StreamId, FederatedInvite)>The invites the syncing user has received over federation
Implementations§
Source§impl SyncData
impl SyncData
Sourceasync fn build_sync_response<'c>(
self,
transaction: &mut TransactedDb<'c>,
user_id: &UserId,
device_id: &DeviceId,
sync_token: SyncToken,
filter_definition: Option<&FilterDefinition>,
) -> Result<SyncResponse, InternalServerError>
async fn build_sync_response<'c>( self, transaction: &mut TransactedDb<'c>, user_id: &UserId, device_id: &DeviceId, sync_token: SyncToken, filter_definition: Option<&FilterDefinition>, ) -> Result<SyncResponse, InternalServerError>
Builds a SyncResponse from a pair of a SyncToken and some
SyncData.
It also fetches any needed additional data from the transaction (e.g. events state history, etc)
Sourceasync fn fetch_state_for_room<'c>(
transaction: &mut TransactedDb<'c>,
synced_room: &SyncedRoom,
user_id: &UserId,
room_id: &RoomId,
sync_token: &SyncToken,
) -> Result<Vec<RoomEvent<Verified>>, InternalServerError>
async fn fetch_state_for_room<'c>( transaction: &mut TransactedDb<'c>, synced_room: &SyncedRoom, user_id: &UserId, room_id: &RoomId, sync_token: &SyncToken, ) -> Result<Vec<RoomEvent<Verified>>, InternalServerError>
Given a synced room, fill out the state field
If too many messages have been sent since the last /sync call, we need
to still send all the state events that the user will miss when the
returned timeline has a gap
If this is the first time this room is synced since we joined or were invited to the room, we also need to get the entire state of the room
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyncData
impl RefUnwindSafe for SyncData
impl Send for SyncData
impl Sync for SyncData
impl Unpin for SyncData
impl UnsafeUnpin for SyncData
impl UnwindSafe for SyncData
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§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 moreimpl<T> JsonCastable<CanonicalJsonValue> for T
impl<T> JsonCastable<Value> for T
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more