feat(sdk): Convert ChunkIdentifier to ItemPosition.

This patch implements `From<ChunkIdentifier>` for `ItemPosition`.
It's useful when we get a `ChunkIdentifier` and we need to `insert_…
_at(item_position)`.
This commit is contained in:
Ivan Enderlin
2024-03-18 12:21:21 +01:00
parent 2bb07d6a4e
commit 9c4318d191

View File

@@ -598,6 +598,12 @@ impl ItemPosition {
}
}
impl From<ChunkIdentifier> for ItemPosition {
fn from(chunk_identifier: ChunkIdentifier) -> Self {
Self(chunk_identifier, 0)
}
}
/// An iterator over a [`LinkedChunk`] that traverses the chunk in backward
/// direction (i.e. it calls `previous` on each chunk to make progress).
pub struct LinkedChunkIterBackward<'a, Item, Gap, const CAP: usize> {