pub struct CompactSourceMap {
pub base_uri: String,
pub line_starts: Vec<usize>,
pub text_len: usize,
}Expand description
Compact source map when text is dropped (DropText mode)
Retains line mapping but not source text. Provides line/column location but cannot extract source text spans.
Fields§
§base_uri: String§line_starts: Vec<usize>§text_len: usizeImplementations§
Source§impl CompactSourceMap
impl CompactSourceMap
Sourcepub fn locate(&self, offset: usize) -> SourceLocation
pub fn locate(&self, offset: usize) -> SourceLocation
Convert byte offset to line/column location
Column calculation is approximate (byte offset from line start) since we don’t have the original text to count UTF-8 characters.
Trait Implementations§
Source§impl Clone for CompactSourceMap
impl Clone for CompactSourceMap
Source§fn clone(&self) -> CompactSourceMap
fn clone(&self) -> CompactSourceMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CompactSourceMap
impl RefUnwindSafe for CompactSourceMap
impl Send for CompactSourceMap
impl Sync for CompactSourceMap
impl Unpin for CompactSourceMap
impl UnsafeUnpin for CompactSourceMap
impl UnwindSafe for CompactSourceMap
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