pub struct KindSchema { /* private fields */ }Expand description
The kind schema with every JSON Schema it names compiled.
Implementations§
Source§impl KindSchema
impl KindSchema
Sourcepub fn load(share: &Share, repo: &Repository) -> Result<Self, Error>
pub fn load(share: &Share, repo: &Repository) -> Result<Self, Error>
Load the distribution’s kinds and schemas, then the repository’s additions. A kind or a schema declared by both is an error naming both files; nothing overrides.
Sourcepub fn parse(text: &str, schemas: SchemaSet) -> Result<Self, Error>
pub fn parse(text: &str, schemas: SchemaSet) -> Result<Self, Error>
Parse one kinds document with the given schemas (tests, and the distribution alone).
Sourcepub fn schemas(&self) -> impl Iterator<Item = (&String, &Schema)>
pub fn schemas(&self) -> impl Iterator<Item = (&String, &Schema)>
Every schema, by name, distribution first then repository, each name once.
Sourcepub fn sources(&self) -> &[String]
pub fn sources(&self) -> &[String]
The kinds files this schema was read from, in order, repository-relative when inside the repository.
Sourcepub fn is_declared_kind(&self, name: &str) -> bool
pub fn is_declared_kind(&self, name: &str) -> bool
Is name a kind a markdown file may declare for itself?
Sourcepub fn kinds(&self) -> impl Iterator<Item = (&String, &KindSpec)>
pub fn kinds(&self) -> impl Iterator<Item = (&String, &KindSpec)>
Every kind with its spec, by name.
Sourcepub fn schema_for(&self, spec: &KindSpec) -> Option<&Schema>
pub fn schema_for(&self, spec: &KindSpec) -> Option<&Schema>
The schema a kind names, if it names one.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for KindSchema
impl !UnwindSafe for KindSchema
impl Freeze for KindSchema
impl Send for KindSchema
impl Sync for KindSchema
impl Unpin for KindSchema
impl UnsafeUnpin for KindSchema
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