pub struct Contract {
pub frontmatter: Option<FrontmatterSpec>,
pub body: Option<SectionSeq>,
pub rules: Vec<Box<dyn DocRule>>,
pub description: Option<String>,
}Expand description
A compiled contract for one markdown class: frontmatter schema, body grammar, and doc-scoped rules.
Fields§
§frontmatter: Option<FrontmatterSpec>validated by the frontmatter plane (frontmatter/* findings)
body: Option<SectionSeq>the heading grammar of the document body
rules: Vec<Box<dyn DocRule>>cross-plane rules over the whole projected tree
description: Option<String>the contract root’s description:, the Finding.hint of a finding with no
nearer description in scope
Implementations§
Source§impl Contract
impl Contract
Sourcepub fn body(self, body: SectionSeq) -> Self
pub fn body(self, body: SectionSeq) -> Self
Set the body grammar.
Sourcepub fn frontmatter(self, spec: FrontmatterSpec) -> Self
pub fn frontmatter(self, spec: FrontmatterSpec) -> Self
Set the frontmatter schema.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Contract
impl !Send for Contract
impl !Sync for Contract
impl !UnwindSafe for Contract
impl Freeze for Contract
impl Unpin for Contract
impl UnsafeUnpin for Contract
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
Mutably borrows from an owned value. Read more