pub struct PieceTable { /* private fields */ }Expand description
Piece Table - main storage structure
Implementations§
Source§impl PieceTable
impl PieceTable
Sourcepub fn insert(&mut self, offset: usize, text: &str)
pub fn insert(&mut self, offset: usize, text: &str)
Insert text at the specified character offset
Sourcepub fn delete(&mut self, start_offset: usize, length: usize)
pub fn delete(&mut self, start_offset: usize, length: usize)
Delete characters in the specified range
Sourcepub fn get_range(&self, start_offset: usize, length: usize) -> String
pub fn get_range(&self, start_offset: usize, length: usize) -> String
Get text in the specified range
Sourcepub fn char_count(&self) -> usize
pub fn char_count(&self) -> usize
Get the total character count of the document
Sourcepub fn byte_count(&self) -> usize
pub fn byte_count(&self) -> usize
Get the total byte count of the document
Sourcepub fn add_buffer_size(&self) -> usize
pub fn add_buffer_size(&self) -> usize
Get the size of add_buffer (for memory testing)
Sourcepub fn set_gc_threshold(&mut self, threshold: usize)
pub fn set_gc_threshold(&mut self, threshold: usize)
Set GC threshold
Auto Trait Implementations§
impl Freeze for PieceTable
impl RefUnwindSafe for PieceTable
impl Send for PieceTable
impl Sync for PieceTable
impl Unpin for PieceTable
impl UnwindSafe for PieceTable
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