From 07f9e998e9fe6d7fc2ddbd8c032bf8b476afc15e Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 26 Feb 2026 14:28:54 +0100 Subject: [PATCH] doc(sdk): Add missing, or fix existing documentation. --- .../matrix-sdk/src/event_cache/caches/room/state.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/matrix-sdk/src/event_cache/caches/room/state.rs b/crates/matrix-sdk/src/event_cache/caches/room/state.rs index d12131e41..546453edc 100644 --- a/crates/matrix-sdk/src/event_cache/caches/room/state.rs +++ b/crates/matrix-sdk/src/event_cache/caches/room/state.rs @@ -241,8 +241,14 @@ impl RoomEventCacheStateLock { } } +/// The read-lock guard around [`RoomEventCacheState`]. +/// +/// See [`RoomEventCacheStateLock::read`] to acquire it. pub type RoomEventCacheStateLockReadGuard<'a> = lock::StateLockReadGuard<'a, RoomEventCacheState>; +/// The write-lock guard around [`RoomEventCacheState`]. +/// +/// See [`RoomEventCacheStateLock::write`] to acquire it. pub type RoomEventCacheStateLockWriteGuard<'a> = lock::StateLockWriteGuard<'a, RoomEventCacheState>; impl<'a> lock::Reload for RoomEventCacheStateLockWriteGuard<'a> { @@ -268,11 +274,12 @@ impl<'a> lock::Reload for RoomEventCacheStateLockWriteGuard<'a> { } impl<'a> RoomEventCacheStateLockReadGuard<'a> { - /// Returns a read-only reference to the underlying room linked chunk. + /// Return a read-only reference to the underlying room linked chunk. pub fn room_linked_chunk(&self) -> &EventLinkedChunk { &self.state.room_linked_chunk } + /// Return the subscriber count. pub fn subscriber_count(&self) -> &Arc { &self.state.subscriber_count } @@ -389,7 +396,7 @@ impl<'a> RoomEventCacheStateLockReadGuard<'a> { } impl<'a> RoomEventCacheStateLockWriteGuard<'a> { - /// Returns a write reference to the underlying room linked chunk. + /// Return a write reference to the underlying room linked chunk. #[cfg(any(feature = "e2e-encryption", test))] pub fn room_linked_chunk(&mut self) -> &mut EventLinkedChunk { &mut self.state.room_linked_chunk