Creates a new leaf (token) in a branch. # Arguments `id` - The leaf ID `branch_id` - The parent branch `kind` - The token kind `content_range` - Byte range in the content blob `after` - Insert after this leaf, or `None` for start
(
&mut self,
id: LeafId,
branch_id: BranchId,
kind: TokenKind,
content_range: Range<u32>,
after: Option<LeafId>,
)
| 438 | /// * `content_range` - Byte range in the content blob |
| 439 | /// * `after` - Insert after this leaf, or `None` for start |
| 440 | fn create_leaf( |
| 441 | &mut self, |
| 442 | id: LeafId, |
| 443 | branch_id: BranchId, |
| 444 | kind: TokenKind, |
| 445 | content_range: Range<u32>, |
| 446 | after: Option<LeafId>, |
| 447 | ) -> Result<Leaf, Self::Error> { |
| 448 | let leaf = Leaf::new(id, branch_id, kind, content_range); |
| 449 | self.put_leaf(&leaf, after)?; |
| 450 | Ok(leaf) |
| 451 | } |
| 452 | |
| 453 | /// Marks a leaf as deleted. |
| 454 | fn mark_leaf_deleted(&mut self, id: LeafId) -> Result<(), Self::Error> { |