Expand description

Support for Source Bundles, a proprietary archive containing source code.

This module defines the SourceBundle type. Since not all object file containers specify a standardized way to inline sources into debug information, this can be used to associate source contents to debug files.

Source bundles are ZIP archives with a well-defined internal structure. Most importantly, they contain source files in a nested directory structure. Additionally, there is meta data associated to every source file, which allows to store additional properties, such as the original file system path, a web URL, and custom headers.

The internal structure is as follows:

manifest.json
files/
  file1.txt
  subfolder/
    file2.txt

SourceBundle implements the ObjectLike trait. When created from another object, it carries over its meta data, such as the debug_id or code_id. However, source bundles never store symbols or debug information. To obtain sources or iterate files stored in this source bundle, use SourceBundle::debug_session.

Source bundles can be created manually or by converting any ObjectLike using SourceBundleWriter.

Artifact Bundles

Source bundles share the format with a related concept, called an “artifact bundle”. Artifact bundles are essentially source bundles but they typically contain sources referred to by JavaScript source maps and source maps themselves. For instance in an artifact bundle a file entry has a url and might carry headers or individual debug IDs per source file.

Structs

Enums

Type Aliases