#[non_exhaustive]pub struct Schema {
pub version: SchemaVersion,
pub options: Options,
pub frontmatter: FrontmatterPolicy,
pub outline: Vec<SectionRule>,
pub constraints: Vec<Constraint>,
pub outline_provenance: OutlineProvenance,
}Expand description
A parsed Outlint schema.
Obtain this value from load_schema or
load_schema_with_resources. Although
its normalized fields are public for inspection, constructing them directly
can bypass loader-established invariants such as valid references and
compiled matchers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.version: SchemaVersionThe schema language version used by this document.
options: OptionsDocument parsing and matching options, with defaults already applied.
frontmatter: FrontmatterPolicyThe normalized frontmatter presence and value-validation policy.
outline: Vec<SectionRule>Rules for the document’s h1 headers, in first-match order.
This is the canonical form of the schema’s top level. The
title: + sections: sugar desugars into a single synthesized rule
here — its matcher is the title matcher (or any-text when no title is
declared), its cardinality is exactly one, and its child rules are the
top-level sections list. Schema::outline_provenance records which
spelling produced the list; public ScopePaths keep addressing what
the source spelled, so for sugar schemas the empty scope names the
synthesized rule’s child scope rather than this list.
constraints: Vec<Constraint>Presence and ordering constraints attached to the outline (h1) scope.
Only the general outline: form can declare these. A sugar schema’s
top-level constraints attach to the synthesized rule’s child scope
(its constraints field) — the scope the sections list describes —
so this list is empty for every sugar schema.
outline_provenance: OutlineProvenanceHow the source document declared its h1 level.
Trait Implementations§
impl Eq for Schema
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.