pub struct CoreSchema {
pub line_limit: i64,
pub lifecycle: Vec<LifecycleDimension>,
pub frontmatter: Vec<(String, FrontmatterConstraint)>,
pub frontmatter_open: bool,
pub prohibited_patterns: Vec<Prohibition>,
pub formats: FormatRegistry,
pub guidance: Option<String>,
pub examples: Vec<Example>,
pub line: usize,
pub key_lines: BTreeMap<String, usize>,
}Expand description
The part of a lowered schema that every format shares: grammar
schema, the keys of the core grammar.
Fields§
§line_limit: i64line-limit; zero or less declares no limit.
lifecycle: Vec<LifecycleDimension>lifecycle.
frontmatter: Vec<(String, FrontmatterConstraint)>frontmatter, in schema order.
frontmatter_open: boolfrontmatter-open.
prohibited_patterns: Vec<Prohibition>prohibited-patterns: what no line of the body may match.
formats: FormatRegistryThe registry as this schema sees it.
guidance: Option<String>guidance: what the schema says that no example can.
examples: Vec<Example>examples.
line: usizeThe line of the schema where it is written.
key_lines: BTreeMap<String, usize>The line of each key of the schema, by the key.
Implementations§
Source§impl CoreSchema
impl CoreSchema
Sourcepub fn demand_nothing() -> CoreSchema
pub fn demand_nothing() -> CoreSchema
A schema that demands nothing.
Sourcepub fn states(&self, frontmatter: Option<&Spanned>) -> States
pub fn states(&self, frontmatter: Option<&Spanned>) -> States
A document’s lifecycle states, one per dimension its frontmatter carries.
Sourcepub fn type_const(&self) -> Option<&str>
pub fn type_const(&self) -> Option<&str>
The type const, where the type key declares one.
Sourcepub fn constraint(&self, key: &str) -> Option<&FrontmatterConstraint>
pub fn constraint(&self, key: &str) -> Option<&FrontmatterConstraint>
The constraint the schema declares on the frontmatter key.
Sourcepub fn id_template(&self) -> Option<&IdTemplate>
pub fn id_template(&self) -> Option<&IdTemplate>
The id template, if frontmatter.id.template is declared.
Sourcepub fn dimension(&self, key: &str) -> Option<&LifecycleDimension>
pub fn dimension(&self, key: &str) -> Option<&LifecycleDimension>
The lifecycle dimension with key.
Trait Implementations§
Source§impl Clone for CoreSchema
impl Clone for CoreSchema
Auto Trait Implementations§
impl Freeze for CoreSchema
impl RefUnwindSafe for CoreSchema
impl Send for CoreSchema
impl Sync for CoreSchema
impl Unpin for CoreSchema
impl UnsafeUnpin for CoreSchema
impl UnwindSafe for CoreSchema
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