Struct lc3_ensemble::asm::SourceInfo
source · pub struct SourceInfo { /* private fields */ }Expand description
Details some encoding information about the source.
Implementations§
source§impl SourceInfo
impl SourceInfo
sourcepub fn line_span(&self, line: usize) -> Option<Range<usize>>
pub fn line_span(&self, line: usize) -> Option<Range<usize>>
Gets the character range for the provided line, excluding any whitespace.
This returns None if line is not in the interval [0, number of lines).
sourcepub fn get_pos_pair(&self, index: usize) -> (usize, usize)
pub fn get_pos_pair(&self, index: usize) -> (usize, usize)
Calculates the line and character number for a given character index.
If the index exceeds the length of the string, the line number is given as the last line and the character number is given as the number of characters after the start of the line.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SourceInfo
impl RefUnwindSafe for SourceInfo
impl Send for SourceInfo
impl Sync for SourceInfo
impl Unpin for SourceInfo
impl UnwindSafe for SourceInfo
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