feat(sdk): Implement Chunk::content.

This patch implements `Chunk::content` to get an immutable reference to
the content of a chunk.
This commit is contained in:
Ivan Enderlin
2024-03-18 12:22:16 +01:00
parent 9c4318d191
commit 4774cc8e65

View File

@@ -736,6 +736,11 @@ impl<Item, Gap, const CAPACITY: usize> Chunk<Item, Gap, CAPACITY> {
self.identifier
}
/// Get the content of the chunk.
pub fn content(&self) -> &ChunkContent<T, U> {
&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.