pub struct Specification {
pub name: String,
pub ifc_versions: Vec<IfcVersion>,
pub identifier: Option<String>,
pub description: Option<String>,
pub instructions: Option<String>,
pub applicability: Applicability,
pub requirements: Option<Requirements>,
}Expand description
One <specification>.
Fields§
§name: String@name, required.
ifc_versions: Vec<IfcVersion>@ifcVersion, an xs:list: "IFC2X3 IFC4" is two releases.
identifier: Option<String>@identifier. Not unique across documents, by the schema’s own note.
description: Option<String>@description.
instructions: Option<String>@instructions, meant for the model author.
applicability: ApplicabilityWhich objects the specification is about.
requirements: Option<Requirements>What those objects must satisfy. None when <requirements> is
absent, which is distinct from an empty <requirements/> only in the
description it can carry.
Implementations§
Source§impl Specification
impl Specification
Sourcepub fn new(
name: impl Into<String>,
ifc_versions: impl IntoIterator<Item = IfcVersion>,
) -> Self
pub fn new( name: impl Into<String>, ifc_versions: impl IntoIterator<Item = IfcVersion>, ) -> Self
A specification of the given IFC releases with an empty, optional applicability and no requirements.
Optional (minOccurs="0" maxOccurs="unbounded") means the
requirements apply to whatever objects match, and a model with none
passes. Use Applicability::set_occurrence to demand or prohibit
applicable objects. Add at least one applicability facet before
writing.
Sourcepub fn require(&mut self, requirement: impl Into<Requirement>) -> &mut Self
pub fn require(&mut self, requirement: impl Into<Requirement>) -> &mut Self
Appends a requirement, creating <requirements> if absent.
Sourcepub fn occurrence(&self) -> Occurrence
pub fn occurrence(&self) -> Occurrence
How many applicable objects the specification demands.
Lowered from the applicability’s minOccurs/maxOccurs: 0..0 is
prohibited, 0..n optional, anything with a non-zero minimum required.