MappedPath

Enum MappedPath 

Source
pub enum MappedPath {
    Git {
        repo: String,
        path: String,
        rev: String,
    },
    Hg {
        repo: String,
        path: String,
        rev: String,
    },
    S3 {
        bucket: String,
        digest: String,
        path: String,
    },
    Cargo {
        registry: String,
        crate_name: String,
        version: String,
        path: String,
    },
}
Expand description

A special source file path for source files which are hosted online.

About “special path” strings: Special paths strings are a string serialization of a mapped path. The format of this string was adopted from the format used in Firefox Breakpad .sym files. This format is also used in the Tecken symbolication API, and internally in the Firefox Profiler.

Variants§

§

Git

A path to a file in a git repository.

Fields

§repo: String

The web host + root path where the repository is hosted, e.g. "github.com/rust-lang/rust".

§path: String

The path to this file inside the repository, e.g. "library/std/src/sys/unix/thread.rs".

§rev: String

The revision, e.g. "53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b".

§

Hg

A path to a file in a mercurial repository (hg).

Fields

§repo: String

The web host + root path where the repository is hosted, e.g. "hg.mozilla.org/mozilla-central".

§path: String

The path to this file inside the repository, e.g. "widget/cocoa/nsAppShell.mm".

§rev: String

The revision, e.g. "997f00815e6bc28806b75448c8829f0259d2cb28".

§

S3

A path to a file hosted in an S3 bucket.

Fields

§bucket: String

The name of the S3 bucket, e.g. "gecko-generated-sources" (which is hosted at https://gecko-generated-sources.s3.amazonaws.com/).

§digest: String

The “digest” of the file, i.e. a long hash string of hex characters.

§path: String

The path to this file inside the bucket, e.g. "ipc/ipdl/PBackgroundChild.cpp".

§

Cargo

A path to a file in a Rust package which is hosted in a cargo registry (usually on crates.io).

Fields

§registry: String

The name of the cargo registry, usually "github.com-1ecc6299db9ec823".

§crate_name: String

The name of the package, e.g. "tokio".

§version: String

The version of the package, e.g. "1.6.1".

§path: String

The path to this file inside the package, e.g. "src/runtime/task/mod.rs".

Implementations§

Source§

impl MappedPath

Source

pub fn from_special_path_str(special_path: &str) -> Option<Self>

Parse a “special path” string. These types of strings are found in Breakpad .sym files on the Mozilla symbol server.

So this parsing code basically exists here because this crate supports obtaining symbols from Breakpad symbol files, so that consumers don’t have parse this syntax when looking up symbols from a SymbolMap from such a .sym file.

Source

pub fn from_url(url: &str) -> Option<Self>

Detect some URLs of plain text files and convert them to a MappedPath.

Source

pub fn to_special_path_str(&self) -> String

Serialize this mapped path to a string, using the “special path” syntax.

Source

pub fn display_path(&self) -> String

Create a short, display-friendly form of this path.

Trait Implementations§

Source§

impl Clone for MappedPath

Source§

fn clone(&self) -> MappedPath

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 MappedPath

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for MappedPath

Source§

fn eq(&self, other: &MappedPath) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for MappedPath

Source§

impl StructuralPartialEq for MappedPath

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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,