pub enum FilePath {
    Local(PathBuf),
    LocalMapped {
        local: PathBuf,
        mapped: String,
    },
    NonLocal(String),
}

Variants

Local(PathBuf)

A local symbol file refers to a local path. No path mapping was applied.

LocalMapped

Fields

local: PathBuf
mapped: String

A local symbol file refers to a local path but also has a mapped variant of that path which we prefer to return from the symbolication API.

Examples:

  • Local ELF file with DWARF info which refers to a path in a Rust dependency. We have a local source file with the dependency’s code (whose location is in local) but in the API result we return a special path of the type cargo:…:…
  • Local pdb file with a srcsrv stream which maps local paths to github URLs. We have a local file at the raw path but in the API result we return a special path of the type git:…:…
  • Local ELF file with DWARF info which specifies a relative path, resolved relative to the location of that ELF file. We store the resolved absolute path in local and the relative path in mapped.

NonLocal(String)

A non-local symbol file refers to a path which may or may not have been mapped. If it was mapped, we discard the original raw path.

Non-local symbol files aren’t allowed to refer to files on this file system, so we don’t need to know the pre-mapping path.

Examples:

  • A pdb file was downloaded from a symbol server and refers to a source file with an absolute path which was valid on the original build machine where this pdb file was produced. We store that absolute path but we don’t want to open a file at that path on this machine because the pdb file came from somewhere else.
  • Same as the previous example, but with a srcsrv stream which maps the absolute path to a github URL. We map the path to a special path of the type git:…:… and store only the mapped path.

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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.