From 41325712707eca47e06575a3c50dddce86c993ef Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 4 May 2023 09:38:42 +0200 Subject: [PATCH] doc(sdk): Write documentation for `SlidingSyncRoom`. --- crates/matrix-sdk/src/sliding_sync/room.rs | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/crates/matrix-sdk/src/sliding_sync/room.rs b/crates/matrix-sdk/src/sliding_sync/room.rs index e182f0d5c..69e628fcc 100644 --- a/crates/matrix-sdk/src/sliding_sync/room.rs +++ b/crates/matrix-sdk/src/sliding_sync/room.rs @@ -25,15 +25,39 @@ use crate::{ Client, }; -/// Room details, provided by a [`SlidingSync`][super::SlidingSync] instance. +/// A Sliding Sync Room. +/// +/// It contains some information about a specific room, along with a queue of +/// events for the timeline. #[derive(Debug, Clone)] pub struct SlidingSyncRoom { + /// The client, used to fetch [`Room`][crate::room::Room]. client: Client, + + /// The room ID. room_id: OwnedRoomId, + + /// The room representation as a `SlidingSync`'s response from the server. + /// + /// We update this response when an update is needed. inner: v4::SlidingSyncRoom, + + /// ??? + /// + /// We can probably remove this field. is_loading_more: Arc>>, + + /// Whether the room has been loaded from the cache only. is_cold: Arc, + + /// The `prev_batch` data. + /// + /// It's extracted from `Self::inner`. Why this one is extracted and not the + /// others? Maybe it can be simplified. prev_batch: Arc>>>, + + /// A queue of received events, used to build a + /// [`Timeline`][crate::Timeline]. timeline_queue: Arc>>, }