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>
pub fn get_col_offset_at_line( &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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more