Skip to main content

Resolution

Enum Resolution 

Source
pub enum Resolution {
    Path(PathBuf),
    CaseMismatch {
        got: PathBuf,
        actual: String,
    },
    Broken,
    Id {
        id: Id,
        to: PathBuf,
    },
    DanglingId {
        id: Id,
        tombstoned: bool,
    },
    MalformedId,
    AmbiguousAlias {
        name: String,
        candidates: Vec<PathBuf>,
    },
    External,
    Foreign {
        workspace: String,
        id: Id,
    },
}
Expand description

How a forward link resolves against the workspace. Path and id forms stay distinct on purpose: the registry owns id resolution (location-independent, stable across moves), while a path is checked against the on-disk name — so a caller can tell which links a rename must rewrite (paths) from which it must leave alone (ids).

Variants§

§

Path(PathBuf)

A path target that resolves to an existing file (exact name).

§

CaseMismatch

A path target that only matches case-insensitively; got is the target as resolved, actual the exact on-disk name.

Fields

§actual: String
§

Broken

A path target with nothing on disk.

§

Id

A prov:<id> target the registry resolves to the live path to.

Fields

§id: Id
§

DanglingId

A well-formed prov:<id> target with no live registry entry; tombstoned separates “deleted” from “never issued here” (§4 hazard).

Fields

§id: Id
§tombstoned: bool
§

MalformedId

A prov:<id> target failing its check character — a typo.

§

AmbiguousAlias

A nominal (alias) target several documents claim — unresolvable. candidates are the sharers, sorted.

Fields

§name: String
§candidates: Vec<PathBuf>
§

External

A URL / mail address — off-workspace, never resolved or rewritten.

§

Foreign

An id:<workspace>/<id> target naming a document in another workspace.

A clean resolution, not a finding: prov holds no map from a workspace name to a location (see Target::Foreign), so it has no evidence either way about whether the target exists. Reporting a link it cannot check as broken would be a false positive every host would then have to suppress — and a check that must be filtered is one nobody reads. The id is deliberately not check-verified: the foreign workspace owns its id space and need not be a prov workspace.

Fields

§workspace: String
§id: Id

Implementations§

Source§

impl Resolution

Source

pub fn resolved_path(&self) -> Option<&PathBuf>

The workspace path this link reaches, if it resolves to one (by path or through the registry) — what the spanning walk descends into and what a backlink map keys on. None for broken, dangling, malformed, external.

Trait Implementations§

Source§

impl Clone for Resolution

Source§

fn clone(&self) -> Resolution

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Resolution

Source§

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

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

impl Eq for Resolution

Source§

impl PartialEq for Resolution

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Resolution

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.