pub struct TemplateValidator { /* private fields */ }Expand description
Template output validator
Validates rendered template content for:
- Correct format (TOML, JSON, YAML)
- Required fields presence
- Schema compliance
- Custom validation rules
Implementations§
Source§impl TemplateValidator
impl TemplateValidator
Sourcepub fn require_fields<I, S>(self, fields: I) -> Self
pub fn require_fields<I, S>(self, fields: I) -> Self
Set required fields that must be present in output
§Arguments
fields- Field paths (e.g., “service.name”, “meta.version”)
Sourcepub fn require_sections<I, S>(self, sections: I) -> Self
pub fn require_sections<I, S>(self, sections: I) -> Self
Set required top-level sections for TOML output
§Arguments
sections- Section names that must exist (e.g., “service”, “meta”)
Sourcepub fn with_rule(self, rule: ValidationRule) -> Self
pub fn with_rule(self, rule: ValidationRule) -> Self
Add custom validation rule
Sourcepub fn format(self, format: OutputFormat) -> Self
pub fn format(self, format: OutputFormat) -> Self
Set expected output format
Sourcepub fn with_schema(self, schema: Value) -> Self
pub fn with_schema(self, schema: Value) -> Self
Sourcepub fn with_toml_options(self, options: TomlValidationOptions) -> Self
pub fn with_toml_options(self, options: TomlValidationOptions) -> Self
Set TOML validation options
Trait Implementations§
Source§impl Clone for TemplateValidator
impl Clone for TemplateValidator
Source§fn clone(&self) -> TemplateValidator
fn clone(&self) -> TemplateValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TemplateValidator
impl RefUnwindSafe for TemplateValidator
impl Send for TemplateValidator
impl Sync for TemplateValidator
impl Unpin for TemplateValidator
impl UnwindSafe for TemplateValidator
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