mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-09 00:15:23 -04:00
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:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user