Struct sourcemap::SourceMapIndex [] [src]

pub struct SourceMapIndex { /* fields omitted */ }

Represents a sourcemap index in memory

Methods

impl SourceMapIndex
[src]

[src]

Creates a sourcemap index from a reader over a JSON stream in UTF-8 format. Optionally a "garbage header" as defined by the sourcemap draft specification is supported. In case a regular sourcemap is encountered an error is returned.

[src]

Writes a sourcemap index into a writer.

[src]

Creates a sourcemap index from a reader over a JSON byte slice in UTF-8 format. Optionally a "garbage header" as defined by the sourcemap draft specification is supported. In case a regular sourcemap is encountered an error is returned.

[src]

Constructs a new sourcemap index from raw components.

  • file: an optional filename of the index
  • sections: a vector of source map index sections

[src]

Returns the embedded filename in case there is one.

[src]

Sets a new value for the file.

[src]

Returns the number of sections in this index

[src]

Looks up a single section and returns it

[src]

Looks up a single section and returns it as a mutable ref

Important traits for SourceMapSectionIter<'a>
[src]

Iterates over all sections

[src]

Looks up the closest token to a given line and column.

This requires that the referenced sourcemaps are actually loaded. If a sourcemap is encountered that is not embedded but just externally referenced it is silently skipped.

[src]

Flattens an indexed sourcemap into a regular one. This requires that all referenced sourcemaps are attached.

[src]

Flattens an indexed sourcemap into a regular one and automatically rewrites it. This is more useful than plain flattening as this will cause the sourcemap to be properly deduplicated.

Trait Implementations

Auto Trait Implementations

impl !Send for SourceMapIndex

impl !Sync for SourceMapIndex