pub struct LineStarts(/* private fields */);
Expand description
Contains the byte indexes of when line starts
Implementations§
Source§impl LineStarts
impl LineStarts
Sourcepub fn new(source: &str) -> LineStarts
pub fn new(source: &str) -> LineStarts
Implementation copied from codespan-reporting
pub fn append(&mut self, start: usize, appended: &str)
pub fn byte_indexes_on_same_line(&self, pos1: usize, pos2: usize) -> bool
pub fn byte_indexes_crosses_lines(&self, pos1: usize, pos2: usize) -> usize
pub fn byte_indexes_on_different_lines(&self, pos1: usize, pos2: usize) -> bool
Trait Implementations§
Source§impl Clone for LineStarts
impl Clone for LineStarts
Source§fn clone(&self) -> LineStarts
fn clone(&self) -> LineStarts
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for LineStarts
impl RefUnwindSafe for LineStarts
impl Send for LineStarts
impl Sync for LineStarts
impl Unpin for LineStarts
impl UnwindSafe for LineStarts
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