pub struct SourceMap(/* private fields */);Expand description
A collection of SourceMarker.
Sourcemaps are used to map positions in the original source to positions in the transformed code. Here, only the boundaries of edits are tracked instead of every single character.
This mapping maintains the invariant that markers are in source order.
Implementations§
Source§impl SourceMap
impl SourceMap
Sourcepub fn markers(&self) -> &[SourceMarker]
pub fn markers(&self) -> &[SourceMarker]
Returns a slice of all the markers in the sourcemap in source order.
Sourcepub fn push_start_marker(&mut self, edit: &Edit, output_length: TextSize)
pub fn push_start_marker(&mut self, edit: &Edit, output_length: TextSize)
Sourcepub fn push_end_marker(&mut self, edit: &Edit, output_length: TextSize)
pub fn push_end_marker(&mut self, edit: &Edit, output_length: TextSize)
Sourcepub fn push_marker(&mut self, offset: TextSize, output_length: TextSize)
pub fn push_marker(&mut self, offset: TextSize, output_length: TextSize)
Trait Implementations§
impl Eq for SourceMap
impl StructuralPartialEq for SourceMap
Auto Trait Implementations§
impl Freeze for SourceMap
impl RefUnwindSafe for SourceMap
impl Send for SourceMap
impl Sync for SourceMap
impl Unpin for SourceMap
impl UnsafeUnpin for SourceMap
impl UnwindSafe for SourceMap
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.