From 4774cc8e65bef225787f0197786a4f1ef38cdeea Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Mon, 18 Mar 2024 12:22:16 +0100 Subject: [PATCH] feat(sdk): Implement `Chunk::content`. This patch implements `Chunk::content` to get an immutable reference to the content of a chunk. --- crates/matrix-sdk/src/event_cache/linked_chunk.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/matrix-sdk/src/event_cache/linked_chunk.rs b/crates/matrix-sdk/src/event_cache/linked_chunk.rs index e11f38f34..7490e0dad 100644 --- a/crates/matrix-sdk/src/event_cache/linked_chunk.rs +++ b/crates/matrix-sdk/src/event_cache/linked_chunk.rs @@ -736,6 +736,11 @@ impl Chunk { self.identifier } + /// Get the content of the chunk. + pub fn content(&self) -> &ChunkContent { + &self.content + } + /// The length of the chunk, i.e. how many items are in it. /// /// It will always return 0 if it's a gap chunk.