pub struct LineIndex { /* private fields */ }Implementations§
Source§impl LineIndex
impl LineIndex
pub fn parse(text: &str) -> LineIndex
pub fn get_line_offset(&self, line: usize) -> Option<TextSize>
pub fn get_line(&self, offset: TextSize) -> Option<usize>
pub fn get_line_with_start_offset( &self, offset: TextSize, ) -> Option<(usize, TextSize)>
pub fn is_line_only_ascii(&self, line: TextSize) -> bool
pub fn line_count(&self) -> usize
pub fn get_col(&self, offset: TextSize, source_text: &str) -> Option<usize>
pub fn get_line_col( &self, offset: TextSize, source_text: &str, ) -> Option<(usize, usize)>
pub fn get_offset( &self, line: usize, col: usize, source_text: &str, ) -> Option<TextSize>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LineIndex
impl RefUnwindSafe for LineIndex
impl Send for LineIndex
impl Sync for LineIndex
impl Unpin 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