pub struct Report<'a> { /* private fields */ }Expand description
The problems found in one text, in document order.
A Report is Send but not Sync: location caches the line starts,
character counts and its furthest answer inside the report. To share one between threads,
put it behind a Mutex, or look up the locations first.
Implementations§
Source§impl<'a> Report<'a>
impl<'a> Report<'a>
Sourcepub fn location(&self, offset: usize) -> Location
pub fn location(&self, offset: usize) -> Location
The line and column of a byte offset in the text. The first call finds the line starts; later calls cost a binary search, and in text that is not all ASCII a count of the characters before the offset on its line. That count goes on from the furthest offset found on the same line, or else covers at most a few KiB, using character counts kept every few KiB from the start of the text. An offset past the end is treated as the end.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for Report<'a>
impl<'a> !RefUnwindSafe for Report<'a>
impl<'a> !Sync for Report<'a>
impl<'a> Send for Report<'a>
impl<'a> Unpin for Report<'a>
impl<'a> UnsafeUnpin for Report<'a>
impl<'a> UnwindSafe for Report<'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