pub struct DiffReport {
pub before: String,
pub after: String,
pub added: Vec<String>,
pub removed: Vec<String>,
pub renamed: Vec<(String, String)>,
pub content_changed: Vec<String>,
pub frontmatter_changed: Vec<String>,
pub trust_changed: Vec<TrustMove>,
pub links_broken: Vec<(String, String)>,
pub links_mended: Vec<(String, String)>,
}Expand description
What changed between two bundles, semantically rather than by bytes.
ADR-0021 made render okf byte-deterministic specifically so “a consumer can
diff two downloads and learn something”. This is that diff, and it is the
first thing in the workspace to exercise the determinism: review --base
diffs code, not bundles.
A rename is the interesting field. A textual diff of two bundles reports a moved concept as one deletion and one unrelated addition; this reports it as a rename, which is the difference between “we lost a concept” and “we moved one”.
Fields§
§before: StringThe bundle taken as “before”.
after: StringThe bundle taken as “after”.
added: Vec<String>Concepts present only in after.
removed: Vec<String>Concepts present only in before.
renamed: Vec<(String, String)>Concepts whose path changed, as (from, to).
content_changed: Vec<String>Concepts whose body changed.
frontmatter_changed: Vec<String>Concepts whose frontmatter keys changed.
trust_changed: Vec<TrustMove>Concepts whose tier or status moved. The one to read first.
links_broken: Vec<(String, String)>Links that broke between before and after, as (concept, target).
links_mended: Vec<(String, String)>Links that were broken in before and resolve in after.
Implementations§
Source§impl DiffReport
impl DiffReport
Sourcepub fn is_unchanged(&self) -> bool
pub fn is_unchanged(&self) -> bool
true when the two bundles are semantically identical.
Trait Implementations§
Source§impl Clone for DiffReport
impl Clone for DiffReport
Source§fn clone(&self) -> DiffReport
fn clone(&self) -> DiffReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more