pub struct LineIndex { /* private fields */ }Implementations§
Source§impl LineIndex
impl LineIndex
pub fn from_str(text: &str) -> Self
pub fn apply_edit(&mut self, start: usize, deleted_len: usize, inserted: &str)
pub fn starts(&self) -> &[usize]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn line_count(&self) -> usize
pub fn line_of(&self, offset: usize) -> usize
pub fn line_col(&self, offset: usize) -> (usize, usize)
pub fn line_start(&self, line: usize) -> usize
pub fn line_range(&self, line: usize) -> (usize, usize)
pub fn offset_of(&self, line: usize, col_bytes: usize) -> usize
Trait Implementations§
impl Eq for LineIndex
impl StructuralPartialEq for LineIndex
Auto Trait Implementations§
impl Freeze for LineIndex
impl RefUnwindSafe for LineIndex
impl Send for LineIndex
impl Sync for LineIndex
impl Unpin for LineIndex
impl UnsafeUnpin for LineIndex
impl UnwindSafe for LineIndex
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