pub struct ProjectUnits { /* private fields */ }Expand description
The set of units a file declares in its IfcUnitAssignment, keyed by
unit-type token ("LENGTHUNIT", "VOLUMETRICFLOWRATEUNIT", …). Only the
unit-types the file actually declares are present; anything else falls back
to the IFC-canonical SI default in ProjectUnits::unit_for_measure.
Implementations§
Source§impl ProjectUnits
impl ProjectUnits
Sourcepub fn resolve(decoder: &mut EntityDecoder<'_>, project_id: u32) -> Self
pub fn resolve(decoder: &mut EntityDecoder<'_>, project_id: u32) -> Self
Resolve the full unit assignment reachable from project_id. Never
fails: an absent / malformed assignment yields an empty table (all
measures then fall back to their SI default symbols).
Sourcepub fn unit_for_measure(&self, measure_type: &str) -> Option<ResolvedUnit>
pub fn unit_for_measure(&self, measure_type: &str) -> Option<ResolvedUnit>
The display unit for a property/quantity whose IFC measure value type is
measure_type (e.g. "IfcVolumetricFlowRateMeasure"). Prefers the
file’s declared unit for the measure’s unit-type and otherwise falls back
to the IFC-canonical SI default. Returns None for dimensionless
measures (ratios, counts) and non-measure value types (labels, …).
Sourcepub fn resolved_for_unit_type(&self, unit_type: &str) -> Option<&ResolvedUnit>
pub fn resolved_for_unit_type(&self, unit_type: &str) -> Option<&ResolvedUnit>
The resolved unit the file declares for a raw unit-type token, if any.
Sourcepub fn monetary(&self) -> Option<&ResolvedUnit>
pub fn monetary(&self) -> Option<&ResolvedUnit>
The resolved monetary (currency) unit, if the file declares one.
Sourcepub fn declared_len(&self) -> usize
pub fn declared_len(&self) -> usize
Number of declared unit-types (excluding monetary). Test/telemetry aid.
Trait Implementations§
Source§impl Clone for ProjectUnits
impl Clone for ProjectUnits
Source§fn clone(&self) -> ProjectUnits
fn clone(&self) -> ProjectUnits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more