pub struct SchemaValidator { /* private fields */ }Expand description
Schema validator for experiments and EMCs
Implementations§
Source§impl SchemaValidator
impl SchemaValidator
Sourcepub fn from_files(
experiment_schema_path: &Path,
emc_schema_path: &Path,
) -> Result<Self, SchemaValidationError>
pub fn from_files( experiment_schema_path: &Path, emc_schema_path: &Path, ) -> Result<Self, SchemaValidationError>
Create new validator from schema files
§Errors
Returns error if schema files cannot be read or parsed
Sourcepub fn from_embedded() -> Self
pub fn from_embedded() -> Self
Create validator from embedded schemas (for use without file access).
§Panics
Panics if embedded schema files are invalid JSON. This is a compile-time guarantee and indicates a build system error, not a runtime condition.
Sourcepub fn validate_experiment(
&self,
yaml_content: &str,
) -> Result<(), SchemaValidationError>
pub fn validate_experiment( &self, yaml_content: &str, ) -> Result<(), SchemaValidationError>
Validate experiment YAML against schema
§Errors
Returns error if YAML is invalid or doesn’t conform to schema
Sourcepub fn validate_emc(
&self,
yaml_content: &str,
) -> Result<(), SchemaValidationError>
pub fn validate_emc( &self, yaml_content: &str, ) -> Result<(), SchemaValidationError>
Validate EMC YAML against schema
§Errors
Returns error if YAML is invalid or doesn’t conform to schema
Sourcepub fn validate_experiment_file(
&self,
path: &Path,
) -> Result<(), SchemaValidationError>
pub fn validate_experiment_file( &self, path: &Path, ) -> Result<(), SchemaValidationError>
Sourcepub fn validate_emc_file(
&self,
path: &Path,
) -> Result<(), SchemaValidationError>
pub fn validate_emc_file( &self, path: &Path, ) -> Result<(), SchemaValidationError>
Auto Trait Implementations§
impl Freeze for SchemaValidator
impl RefUnwindSafe for SchemaValidator
impl Send for SchemaValidator
impl Sync for SchemaValidator
impl Unpin for SchemaValidator
impl UnsafeUnpin for SchemaValidator
impl UnwindSafe for SchemaValidator
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