pub struct LineIndex { /* private fields */ }Expand description
A Locate for one source file: 1-based lines and byte columns from the
file’s text, for spans that start at base in the session byte space.
§Examples
use bcgen_lang::{LineIndex, Locate};
use hir_lang::Span;
let lines = LineIndex::new("app.mox", 0, "a = 1;\nb = 2;\n");
let at = lines.locate(Span::new(7, 8));
assert_eq!((at.file, at.line, at.column), ("app.mox", 2, 1));Implementations§
Trait Implementations§
impl Eq for LineIndex
impl StructuralPartialEq for LineIndex
Auto Trait Implementations§
impl Freeze for LineIndex
impl RefUnwindSafe for LineIndex
impl Send for LineIndex
impl Sync for LineIndex
impl Unpin for LineIndex
impl UnsafeUnpin 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