pub struct Pieces {
pub nodes: PrimaryMap<NodeRef, Node>,
}Fields§
§nodes: PrimaryMap<NodeRef, Node>Implementations§
Source§impl Pieces
impl Pieces
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, index: NodeRef) -> &Node
pub fn get_piece(&self, index: NodeRef) -> Piece
pub fn alloc( &mut self, color: Color, left: NodeRef, piece: Piece, right: NodeRef, ) -> NodeRef
Sourcepub fn extend_piece(
&mut self,
root: NodeRef,
piece_start_offset: u32,
add_len: u32,
add_chars: u32,
add_nl: u32,
) -> NodeRef
pub fn extend_piece( &mut self, root: NodeRef, piece_start_offset: u32, add_len: u32, add_chars: u32, add_nl: u32, ) -> NodeRef
Extends a piece without triggering Red-Black structural changes. It creates a single new path to the root to maintain persistence.
pub fn insert_node(&mut self, root: NodeRef, piece: Piece, at: u32) -> NodeRef
pub fn remove_node(&mut self, root: NodeRef, at: u32) -> NodeRef
pub fn find_offset( &self, root: NodeRef, target_offset: u32, prefer_left: bool, ) -> Option<(NodeRef, u32)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pieces
impl RefUnwindSafe for Pieces
impl Send for Pieces
impl Sync for Pieces
impl Unpin for Pieces
impl UnsafeUnpin for Pieces
impl UnwindSafe for Pieces
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more