pub struct SchemaDocument {
pub doc: Document,
pub schema_yaml: Option<Spanned>,
pub schema_problem: Option<Finding>,
pub globs: Vec<String>,
pub asset_globs: Vec<String>,
pub type_const: Option<String>,
pub uses: Vec<String>,
pub archived: Archived,
pub loaded: bool,
}Expand description
A SchemaDocument is a schema document together with the schema it holds,
parsed as YAML. When the run has not read the schema file, it is instead a
placeholder that the run builds from the store’s record. The placeholder
holds the id, the type const, and the globs, but no text. It stays a
placeholder until a check needs the compiled schema (CACHE-1_AC-25).
Fields§
§doc: DocumentThe document, or a placeholder with no text when the run has not read the file.
schema_yaml: Option<Spanned>The schema, parsed from the four-backtick YAML fence.
schema_problem: Option<Finding>Why the schema is absent, when it is.
globs: Vec<String>The additional-files globs, read before compilation.
asset_globs: Vec<String>The asset-files globs, read before compilation.
type_const: Option<String>The type const, read before compilation.
uses: Vec<String>The registry names that the schema’s text uses, t:<type> and
f:<format>. When the formats change, the run uses these names to
find the schemas that the change affects (CACHE-1_AC-17).
archived: ArchivedWhether and how the schema archives its documents, read before compilation.
loaded: boolWhether the run read the file. It is false for a placeholder from the store.
Implementations§
Source§impl SchemaDocument
impl SchemaDocument
Sourcepub fn finding(
&self,
criterion: &'static str,
message: impl Into<String>,
) -> Finding
pub fn finding( &self, criterion: &'static str, message: impl Into<String>, ) -> Finding
finding returns an error about the schema, at the line where its
body starts.
Sourcepub fn placeholder(path: RepoPath, meta: SchemaMeta) -> Self
pub fn placeholder(path: RepoPath, meta: SchemaMeta) -> Self
placeholder builds a schema document from the store’s record of a
schema file that the run has not read (CACHE-1_AC-25). A check can
use the placeholder only to dispatch on its type, to match globs, and
to read its id.