Enum profiler_get_symbols::FilePath
source · [−]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
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 inmapped
.
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
sourceimpl FilePath
impl FilePath
pub fn mapped_path(&self) -> Cow<'_, str>
pub fn into_mapped_path(self) -> String
pub fn local_path(&self) -> Option<&Path>
pub fn into_local_path(self) -> Option<PathBuf>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for FilePath
impl Send for FilePath
impl Sync for FilePath
impl Unpin for FilePath
impl UnwindSafe for FilePath
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more