#[non_exhaustive]pub enum QuantityKind {
Length,
Area,
Volume,
Count,
Weight,
Time,
Number,
}Expand description
What a physical quantity measures.
The kind is the entity type, not a guess from the unit: a file may omit
the unit entirely, and IfcQuantityArea still measures area.
Non-exhaustive: a later release may add a quantity subtype, as IFC4X3
added IfcQuantityNumber.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Length
IfcQuantityLength.
Area
IfcQuantityArea.
Volume
IfcQuantityVolume.
Count
IfcQuantityCount.
Weight
IfcQuantityWeight, measured as mass.
Time
IfcQuantityTime.
Number
IfcQuantityNumber: a number that is not a physical measure, such as
a ratio or a figure a take-off rule defines. Declared only by IFC4X3;
the permissive readers resolve it only in a model whose declared
release has it, and read it as Quantity::Unsupported elsewhere.
Implementations§
Source§impl QuantityKind
impl QuantityKind
Sourcepub fn from_type_name(name: &str) -> Option<Self>
pub fn from_type_name(name: &str) -> Option<Self>
The kind named by an entity type, or None if it is not a simple
quantity. Case-insensitive, because a type name reaching here may
come from a caller rather than the upper-cased parser.
This maps names only; it does not check that a release declares the
entity (IfcQuantityNumber is IFC4X3 only).
Sourcepub fn measure_type(self) -> &'static str
pub fn measure_type(self) -> &'static str
The measure type this kind’s value slot carries.
Fixed by the schema per subtype: an IfcQuantityArea holds an
IfcAreaMeasure and nothing else.
Sourcepub fn required_unit(self) -> Option<&'static str>
pub fn required_unit(self) -> Option<&'static str>
The IfcUnitEnum this quantity’s unit must carry, per WR21.
IfcQuantityCount has no such rule – a count is dimensionless –
and neither has IFC4X3 IfcQuantityNumber, so they constrain
nothing.