pub struct SourceMapBuilder { /* private fields */ }
Expand description

Helper for sourcemap generation

This helper exists because generating and modifying SourceMap objects is generally not very comfortable. As a general aid this type can help.

Implementations§

Creates a new source map builder and sets the file.

Sets the file for the sourcemap (optional)

Returns the currently set file.

Sets a new value for the source_root.

Returns the embedded source_root in case there is one.

Registers a new source with the builder and returns the source ID.

Changes the source name for an already set source.

Looks up a source name for an ID.

Sets the source contents for an already existing source.

Returns the current source contents for a source.

Checks if a given source ID has source contents available.

Loads source contents from locally accessible files if referenced accordingly. Returns the number of loaded source contents

Registers a name with the builder and returns the name ID.

Adds a new mapping to the builder.

Adds a new mapping to the builder.

Shortcut for adding a new mapping based of an already existing token, optionally removing the name.

Strips common prefixes from the sources in the builder

Converts the builder into a sourcemap.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.