Skip to main content

StructuralFact

Enum StructuralFact 

Source
pub enum StructuralFact {
    Unreadable {
        doc: PathBuf,
        error: String,
    },
    IdMismatch {
        doc: PathBuf,
        frontmatter: Id,
        registry: Option<Id>,
    },
    UnregisteredId {
        doc: PathBuf,
        frontmatter: Id,
    },
    UnstampedId {
        doc: PathBuf,
        registry: Id,
    },
    DuplicateContainment {
        doc: PathBuf,
        target: String,
    },
    MissingInverse {
        doc: PathBuf,
        child: PathBuf,
        inverse: String,
    },
    CaseMismatch {
        doc: PathBuf,
        site: LinkSite,
        target: String,
        actual: String,
    },
    BrokenLink {
        doc: PathBuf,
        site: LinkSite,
        target: String,
    },
    ManifestConflict {
        doc: PathBuf,
    },
}
Expand description

A structural observation the walk makes as it traverses — not a verdict, just what it saw: a document that would not load, a self-stored id disagreeing with (or absent from) the registry, a spanning edge that revisits an already-reached node, a spanning child whose inverse field does not point back, or a content pointer that failed to resolve.

These are facts about traversal state — they need the queue, the visited set, the inverse lookup — so only the walk can raise them; a single CensusEntry’s Resolution is not enough (that half of the story is validate’s CensusEntry-keyed prov’s validate instead, since a resolution is already the fact). validate::check turns each variant here into the prov’s Finding that names it — one to one, since the walk already knows exactly what happened and there is nothing left to infer. Keeping the enum here rather than importing Finding is what keeps graph a pure “plain text → walkable graph” layer: it reports what it found, never how that should be judged.

Variants§

§

Unreadable

A document that exists but could not be read or parsed.

Fields

§error: String
§

IdMismatch

A document’s self-stored id frontmatter disagrees with the registry (or claims an id the registry hands to a different document). registry is None when the registry has no record of the path at all under this id.

Fields

§frontmatter: Id
§registry: Option<Id>
§

UnregisteredId

A document carries a self-stored id the registry has no record of.

Fields

§frontmatter: Id
§

UnstampedId

A stamping workspace’s registered document does not carry its own id frontmatter.

Fields

§registry: Id
§

DuplicateContainment

A spanning target already reached by the walk — a cycle or a second parent.

Fields

§target: String
§

MissingInverse

A spanning child whose inverse field does not link back to doc.

Fields

§child: PathBuf
§inverse: String
§

CaseMismatch

A content pointer resolving only case-insensitively.

Fields

§target: String
§actual: String

A content pointer resolving to nothing on disk.

Fields

§target: String
§

ManifestConflict

A node declaring both content and manifest — a sidecar for one payload and for a whole directory at once. The two are mutually exclusive (crate::manifest), and neither reading is safe to pick.

Fields

Trait Implementations§

Source§

impl Clone for StructuralFact

Source§

fn clone(&self) -> StructuralFact

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 StructuralFact

Source§

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

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

impl Eq for StructuralFact

Source§

impl PartialEq for StructuralFact

Source§

fn eq(&self, other: &StructuralFact) -> 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 StructuralFact

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.