pub struct SourceMapDecoder { /* private fields */ }Expand description
Decoder for efficient source map lookups.
This provides O(log n) lookup for original positions from generated positions.
Implementations§
Source§impl SourceMapDecoder
impl SourceMapDecoder
Sourcepub fn lookup(
&self,
generated_line: u32,
generated_column: u32,
) -> Option<&Mapping>
pub fn lookup( &self, generated_line: u32, generated_column: u32, ) -> Option<&Mapping>
Looks up the original position for a generated position.
Sourcepub fn lookup_full(
&self,
generated_line: u32,
generated_column: u32,
) -> Option<OriginalPosition>
pub fn lookup_full( &self, generated_line: u32, generated_column: u32, ) -> Option<OriginalPosition>
Looks up the original position and returns full information.
Sourcepub fn get_line_mappings(&self, line: u32) -> Option<&[BoundedMapping]>
pub fn get_line_mappings(&self, line: u32) -> Option<&[BoundedMapping]>
Returns all mappings for a generated line.
Sourcepub fn generated_line_count(&self) -> usize
pub fn generated_line_count(&self) -> usize
Returns the number of lines in the generated file.
Sourcepub fn source_map(&self) -> &SourceMap
pub fn source_map(&self) -> &SourceMap
Returns the underlying source map.
Sourcepub fn iter_mappings(&self) -> impl Iterator<Item = &BoundedMapping>
pub fn iter_mappings(&self) -> impl Iterator<Item = &BoundedMapping>
Iterates over all mappings.
Trait Implementations§
Source§impl Clone for SourceMapDecoder
impl Clone for SourceMapDecoder
Source§fn clone(&self) -> SourceMapDecoder
fn clone(&self) -> SourceMapDecoder
Returns a duplicate 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 Freeze for SourceMapDecoder
impl RefUnwindSafe for SourceMapDecoder
impl Send for SourceMapDecoder
impl Sync for SourceMapDecoder
impl Unpin for SourceMapDecoder
impl UnsafeUnpin for SourceMapDecoder
impl UnwindSafe for SourceMapDecoder
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