pub struct Mappings<O = ()>where
O: Observer,{ /* private fields */ }
Expand description
A parsed set of mappings that can be queried.
Constructed via parse_mappings
.
Implementations§
Source§impl<O: Observer> Mappings<O>
impl<O: Observer> Mappings<O>
Sourcepub fn by_generated_location(&self) -> &[Mapping]
pub fn by_generated_location(&self) -> &[Mapping]
Get the full set of mappings, ordered by generated location.
Sourcepub fn compute_column_spans(&mut self)
pub fn compute_column_spans(&mut self)
Compute the last generated column of each mapping.
After this method has been called, any mappings with
last_generated_column == None
means that the mapping spans to the end
of the line.
Sourcepub fn by_original_source(&mut self, source: u32) -> &[Mapping]
pub fn by_original_source(&mut self, source: u32) -> &[Mapping]
Get the set of mappings that have original location information for the given source and ordered by original location.
Sourcepub fn by_original_location(
&mut self,
) -> ByOriginalLocation<'_, O::SortByOriginalLocation> ⓘ
pub fn by_original_location( &mut self, ) -> ByOriginalLocation<'_, O::SortByOriginalLocation> ⓘ
Iterate over all mappings that contain original location information, sorted by their original location information.
Sourcepub fn original_location_for(
&self,
generated_line: u32,
generated_column: u32,
bias: Bias,
) -> Option<&Mapping>
pub fn original_location_for( &self, generated_line: u32, generated_column: u32, bias: Bias, ) -> Option<&Mapping>
Get the mapping closest to the given generated location, if any exists.
Sourcepub fn generated_location_for(
&mut self,
source: u32,
original_line: u32,
original_column: u32,
bias: Bias,
) -> Option<&Mapping>
pub fn generated_location_for( &mut self, source: u32, original_line: u32, original_column: u32, bias: Bias, ) -> Option<&Mapping>
Get the mapping closest to the given original location, if any exists.
Sourcepub fn all_generated_locations_for(
&mut self,
source: u32,
original_line: u32,
original_column: Option<u32>,
) -> AllGeneratedLocationsFor<'_> ⓘ
pub fn all_generated_locations_for( &mut self, source: u32, original_line: u32, original_column: Option<u32>, ) -> AllGeneratedLocationsFor<'_> ⓘ
Get all mappings at the given original location.
If original_column
is None
, get all mappings on the given source and
original line regardless what columns they have. If original_column
is
Some
, only return mappings for which all of source, original line, and
original column match.