FilePath

Enum 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 in mapped.

Fields

§local: PathBuf
§mapped: String
§

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§

Source§

impl FilePath

Source

pub fn mapped_path(&self) -> Cow<'_, str>

Source

pub fn into_mapped_path(self) -> String

Source

pub fn local_path(&self) -> Option<&Path>

Source

pub fn into_local_path(self) -> Option<PathBuf>

Trait Implementations§

Source§

impl Clone for FilePath

Source§

fn clone(&self) -> FilePath

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FilePath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.