Skip to main content

ValidateOptions

Struct ValidateOptions 

Source
pub struct ValidateOptions {
Show 16 fields pub required_attributes: bool, pub cardinality: bool, pub references: bool, pub reference_targets: bool, pub class_membership: bool, pub datatypes: bool, pub fixed_values: bool, pub mrid_conformance: bool, pub deprecation: bool, pub dependencies: bool, pub profile_reach: bool, pub headers: bool, pub merge_conflicts: bool, pub serializable: bool, pub profiles: ProfileMask, pub max_diagnostics: usize,
}
Expand description

Which checks to run.

Fields§

§required_attributes: bool

Check that required attributes are present.

§cardinality: bool

Check that multiplicities are respected.

§references: bool

Check that references resolve within the dataset.

§reference_targets: bool

Check that a reference points at an object of the declared target class.

§class_membership: bool

Check that every stored value’s attribute belongs to the object’s class.

The one check about what the store holds rather than about what a document said. Everything else walks the class’s attribute list, so a value filed under an attribute the class does not have is examined by nothing and dropped on export.

§datatypes: bool

Check that each stored value has the shape its attribute declares.

CIM/XML carries no datatype information, so this is only decidable against the RDFS — which is exactly why ENTSO-E’s own guidance tells importers to enrich the data graph from the profile before validating it.

§fixed_values: bool

Check attributes the schema pins with cims:isFixed.

§mrid_conformance: bool

Check that identifiers conform to IEC 61970-552.

§deprecation: bool

Report use of deprecated classes and attributes.

§dependencies: bool

Check that headers declare dependencies that were actually loaded.

§profile_reach: bool

Report attributes whose data belongs to a profile none of the loaded files declares — a header that under-declares what its file contains.

§headers: bool

Check each loaded file’s header against the structural requirements of IEC 61970-552.

§merge_conflicts: bool

Report single-valued attributes two loaded files gave different values for.

Recorded by Dataset as the files are merged, because by the time validation runs one of the two values is gone.

§serializable: bool

Check that the model can actually be serialized as CIM/XML.

Two constraints of the output syntax that the object model cannot express, so nothing else enforces them: a text value must hold only characters XML 1.0 can represent, and an identifier must have an rdf:ID or rdf:about form. Both are satisfied by every conforming model — every IEC 61970-552 identifier is a UUID — and both are reachable from a mis-encoded file or from Object::set. Neither is visible to a well-formedness check of the output: the first because quick-xml does not enforce the Char production, the second because the document is well-formed XML and merely invalid RDF/XML.

§profiles: ProfileMask

Restrict checks to these profiles. Empty means “the profiles the headers declare”, falling back to every profile the schema knows.

§max_diagnostics: usize

Stop after this many diagnostics. Prevents a broken file producing millions.

Implementations§

Source§

impl ValidateOptions

Source

pub fn essential() -> ValidateOptions

Only the checks that indicate genuinely broken data.

Source

pub fn thorough() -> ValidateOptions

Every check, including advisory ones.

Source

pub fn for_profiles(self, profiles: ProfileMask) -> Self

Trait Implementations§

Source§

impl Clone for ValidateOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ValidateOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ValidateOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.