Struct wit_parser::SourceMap

source ·
pub struct SourceMap { /* private fields */ }
Expand description

A listing of source files which are used to get parsed into an UnresolvedPackage.

Implementations§

Creates a new empty source map.

Reads the file path on the filesystem and appends its contents to this SourceMap.

This method pushes a new document into the source map. The name of the document is derived from the filename of the path provided.

Appends the given contents with the given path into this source map.

Each path added to a SourceMap will become a document in the final package. The path provided is not read from the filesystem and is instead only used during error messages. The name provided is the name of the document within the WIT package and must be a valid WIT identifier.

Parses the files added to this source map into an UnresolvedPackage.

All files previously added are considered documents of the package to be returned.

Returns an iterator over all filenames added to this source map.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. Read more

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.