Struct source_map::LineStarts
source · 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 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