pub struct ExpressRules { /* private fields */ }Expand description
The WHERE rules, type rules, global rules and functions of one IFC release, ready to evaluate.
§Where the rule text comes from
The IFC schemas are published by buildingSMART under CC BY-ND 4.0, and
this crate does not redistribute them or anything derived from their
rule text: the bundled tables carry rule labels only. The caller
supplies the release’s .exp file – scripts/fetch-ifc-schemas.sh
fetches and checksums the five releases – and this type reads it at run
time.
§Pairing with the tables
The text must declare the same schema as the bundled tables it is
paired with, and agree with them on every entity’s attribute layout:
ExpressRules::parse refuses IFC4.exp paired with IFC4X3 tables,
and a modified file whose slots would be read wrong.
Cheap to clone: the parsed schema is shared. Send and Sync, so one
parse serves every thread.
Implementations§
Source§impl ExpressRules
impl ExpressRules
Sourcepub fn parse(source: &str, schema: &Schema) -> Result<Self, ExpressError>
pub fn parse(source: &str, schema: &Schema) -> Result<Self, ExpressError>
Reads source, the EXPRESS text of schema’s release.
§Errors
ExpressError when the text does not parse, names another schema,
disagrees with the tables, or uses a name that binds to nothing.
Sourcepub fn parse_bytes(bytes: &[u8], schema: &Schema) -> Result<Self, ExpressError>
pub fn parse_bytes(bytes: &[u8], schema: &Schema) -> Result<Self, ExpressError>
Reads EXPRESS text that is not UTF-8.
The normative IFC files are ASCII, but some copies are Latin-1
(a ° in a remark); each byte is read as one character, which is
exact for everything outside remarks and string literals.
§Errors
As Self::parse.
Sourcepub fn with_limits(self, limits: EvalLimits) -> Self
pub fn with_limits(self, limits: EvalLimits) -> Self
The same rules evaluated under other limits.
Sourcepub fn limits(&self) -> EvalLimits
pub fn limits(&self) -> EvalLimits
The limits evaluation runs under.
Sourcepub fn schema_name(&self) -> &str
pub fn schema_name(&self) -> &str
The schema name the text declares (IFC4X3_ADD2).
Sourcepub fn rule_ids(&self) -> impl Iterator<Item = &str>
pub fn rule_ids(&self) -> impl Iterator<Item = &str>
Every rule id these rules can report, sorted: Entity.Label for an
entity WHERE rule, Type.Label for a type WHERE rule, and
global.Rule for a global rule.
Trait Implementations§
Source§impl Clone for ExpressRules
impl Clone for ExpressRules
Source§fn clone(&self) -> ExpressRules
fn clone(&self) -> ExpressRules
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more