pub struct Lines<'a> { /* private fields */ }Expand description
The line starts of a source, to turn byte points into unist’s UTF-16 lines and columns.
Implementations§
Source§impl<'a> Lines<'a>
impl<'a> Lines<'a>
pub fn new(source: &'a str) -> Self
Sourcepub fn to_unist_point(&self, point: Point) -> UnistPoint
pub fn to_unist_point(&self, point: Point) -> UnistPoint
The unist point of a byte point.
Sourcepub fn to_unist_position(&self, position: &Position<'_>) -> UnistPosition
pub fn to_unist_position(&self, position: &Position<'_>) -> UnistPosition
The unist position of a position, which is unchanged when it is one already.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Lines<'a>
impl<'a> RefUnwindSafe for Lines<'a>
impl<'a> Send for Lines<'a>
impl<'a> Sync for Lines<'a>
impl<'a> Unpin for Lines<'a>
impl<'a> UnsafeUnpin for Lines<'a>
impl<'a> UnwindSafe for Lines<'a>
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