#[non_exhaustive]pub struct Schema { /* private fields */ }Expand description
Approved schema, with local references expanded and use-site policies inherited. Full draft 2020-12 and cross-field validation remain the module’s review duty.
Implementations§
Source§impl Schema
impl Schema
pub fn new(schema: Value) -> Result<Self, Refusal>
pub fn normalized(&self) -> &Value
pub fn digest(&self) -> Result<Digest, CanonicalError>
pub fn defaults(&self) -> Value
Sourcepub fn settings_defaults(&self) -> ReviewedTuple
pub fn settings_defaults(&self) -> ReviewedTuple
Defaults and their sources for a settings reader, without tuple validation.
Sourcepub fn settings_sources(
&self,
effective: &Value,
layers: &[(Layer, &Value)],
sources: BTreeMap<String, Layer>,
) -> BTreeMap<String, Layer>
pub fn settings_sources( &self, effective: &Value, layers: &[(Layer, &Value)], sources: BTreeMap<String, Layer>, ) -> BTreeMap<String, Layer>
Add empty-object attribution for display only. layers contains the
contributing documents in ascending precedence. Do not use the returned
map for review or approval digests.
pub fn validate_layer( &self, layer: Layer, value: &Value, context: &ValidationContext, ) -> Result<(), Refusal>
Sourcepub fn review_tuple(
&self,
layers: &[LayerValue],
context: &ValidationContext,
) -> Result<ReviewedTuple, Refusal>
pub fn review_tuple( &self, layers: &[LayerValue], context: &ValidationContext, ) -> Result<ReviewedTuple, Refusal>
Module-side helper for the normative merge table. Call separately for every affected approved project, including projects not edited by a plan.
Sourcepub fn review_tuple_attributed(
&self,
layers: &[LayerValue],
context: &ValidationContext,
) -> Result<ReviewedTuple, AttributedRefusal>
pub fn review_tuple_attributed( &self, layers: &[LayerValue], context: &ValidationContext, ) -> Result<ReviewedTuple, AttributedRefusal>
Review a tuple, retaining the input layer on failures during its application.
Sourcepub fn credential_refs<'a>(&self, value: &'a Value) -> Vec<&'a str>
pub fn credential_refs<'a>(&self, value: &'a Value) -> Vec<&'a str>
Finds the vault reference IDs named by credential fields in an approved effective value. The same ID can appear more than once.