pub struct AdrDoc {
pub meta: AdrMeta,
pub path: String,
pub sections: Vec<Section>,
pub preamble: String,
pub links: Vec<WikiLink>,
pub versions: VersionFacts,
}Expand description
A fully-parsed ADR: metadata, section structure, and authored links.
Fields§
§meta: AdrMetaFrontmatter metadata.
path: StringRepository-relative path of the ADR file.
sections: Vec<Section>## sections in document order.
preamble: StringThe body text before the first ## heading — in house style, the #
title and the summary table — verbatim and uncapped, with surrounding
blank lines trimmed (the same rule the sections use, see Section::text).
This is the only part of an ADR that belongs to no section, which is
exactly why the adr node carries it and not the whole document: the
sections already hold the body between them, so nothing is stored twice.
The whole document, for a reader who wants it, is on the file: node.
links: Vec<WikiLink>Authored [[…]] links in document order.
versions: VersionFactsWhat the document says about its own version, in three places.
Implementations§
Source§impl AdrDoc
impl AdrDoc
Sourcepub fn text_for_key(&self, key: &str) -> Option<&str>
pub fn text_for_key(&self, key: &str) -> Option<&str>
The full, uncapped text the node key should show, or None if key
names no part of this ADR (or names an empty one).
The inverse of the key grammar Self::key and Self::facts build, and
deliberately their neighbour: a renderer that re-split adr:0015#consequences
with its own rule would be reimplementing the thing it is trying to read.
The split is the point. adr:0015 gets its preamble and a section gets its
own span — never the whole document, which is what a path-only rule would
hand to all twenty ADR notes and all 179 section notes alike, beside the
file: note that already carries it once.
Trait Implementations§
impl Eq for AdrDoc
impl StructuralPartialEq for AdrDoc
Auto Trait Implementations§
impl Freeze for AdrDoc
impl RefUnwindSafe for AdrDoc
impl Send for AdrDoc
impl Sync for AdrDoc
impl Unpin for AdrDoc
impl UnsafeUnpin for AdrDoc
impl UnwindSafe for AdrDoc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.