Skip to main content

LinkReport

Struct LinkReport 

Source
pub struct LinkReport {
    pub root: String,
    pub concepts: usize,
    pub links: usize,
    pub broken: Vec<BrokenLink>,
    pub non_concept: Vec<NonConceptLink>,
}
Expand description

Whether an emitted bundle’s internal links resolve.

Roteiro’s own link checking (roteiro check) covers the graph and the rendered site. Neither looks at an emitted OKF bundle, which is a third artefact produced by a third code path — the one ADR-0021 records guessing wrong for 43 links.

Fields§

§root: String

The bundle root, as the caller named it.

§concepts: usize

Concepts read.

§links: usize

Internal concept links found across every body.

§broken: Vec<BrokenLink>

Targets the bundle does not contain at all — dead links, and the only thing --check gates on.

§non_concept: Vec<NonConceptLink>

Targets the bundle does contain, but which are not concepts: an asset such as a diagram or a data file, or one of the reserved index.md / log.md. Reported, never gated — see LinkReport::is_clean.

Implementations§

Source§

impl LinkReport

Source

pub const fn is_clean(&self) -> bool

true when every internal link names something the bundle contains.

Not “every link resolves to a concept”, which is what this used to mean and was the defect in issue #778. A bundle of any size links to its own diagrams and data files; those resolve to no concept, so gating on that made --check fail on every such bundle. On one real bundle it reported 17 broken links of which all 17 existed on disk, and the single genuinely dead link was indistinguishable in the output — which is the failure worth avoiding, because a gate that cries wolf gets switched off and takes the real dead link with it.

So a present-but-not-a-concept target is reported in LinkReport::non_concept and does not fail the gate, which also lines this command up with okf info (which already lists those files as bundle contents) and okf validate (which already rates them info).

Trait Implementations§

Source§

impl Clone for LinkReport

Source§

fn clone(&self) -> LinkReport

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 LinkReport

Source§

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

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

impl Serialize for LinkReport

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.