pub struct TextBuffer { /* private fields */ }Implementations§
Source§impl TextBuffer
impl TextBuffer
pub fn new() -> Self
pub fn from(text: impl Into<String>) -> Self
pub fn len_bytes(&self) -> usize
pub fn len_chars(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn lines(&self) -> &LineIndex
pub fn to_string(&self) -> String
pub fn chunks(&self) -> impl Iterator<Item = &str>
pub fn chunk_offsets(&self) -> Vec<(usize, &str)>
pub fn chars(&self) -> impl Iterator<Item = char> + '_
pub fn substring(&self, range: Range<usize>) -> String
pub fn snap(&self, offset: usize) -> usize
pub fn insert(&mut self, offset: usize, text: &str)
pub fn delete(&mut self, range: Range<usize>) -> String
pub fn replace(&mut self, range: Range<usize>, text: &str) -> String
Trait Implementations§
Source§impl Clone for TextBuffer
impl Clone for TextBuffer
Source§impl Debug for TextBuffer
impl Debug for TextBuffer
Auto Trait Implementations§
impl Freeze for TextBuffer
impl RefUnwindSafe for TextBuffer
impl Send for TextBuffer
impl Sync for TextBuffer
impl Unpin for TextBuffer
impl UnsafeUnpin for TextBuffer
impl UnwindSafe for TextBuffer
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