#[non_exhaustive]pub enum ExactUnitError {
Show 19 variants
Structure(ExactPropertyError),
MeasureNotInSchema {
measure_type: Arc<str>,
schema: SchemaVersion,
},
NotAMeasure {
measure_type: Arc<str>,
},
UnmappedMeasureType {
measure_type: Arc<str>,
},
UnexpectedUnit {
unit: EntityId,
},
DamagedRecord {
entity: EntityId,
diagnostic: usize,
},
NoProject,
MultipleProjects {
first: EntityId,
second: EntityId,
},
NoProjectUnit {
unit_type: Arc<str>,
},
DuplicateProjectUnit {
unit_type: Arc<str>,
first: EntityId,
second: EntityId,
},
UnsupportedUnit {
unit: EntityId,
type_name: Arc<str>,
},
MalformedUnit {
entity: EntityId,
attribute: &'static str,
},
UnknownPrefix {
unit: EntityId,
prefix: Arc<str>,
},
UnknownUnitName {
unit: EntityId,
name: Arc<str>,
},
UnitTypeMismatch {
unit: EntityId,
expected: Arc<str>,
found: Arc<str>,
},
DimensionMismatch {
unit: EntityId,
expected: [i32; 7],
found: [i32; 7],
},
UnsupportedOffset {
unit: EntityId,
},
CyclicConversion {
cycle: Vec<EntityId>,
},
ConversionChainTooDeep {
unit: EntityId,
max_depth: usize,
},
}Expand description
Why a measure’s unit cannot be resolved exactly.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Structure(ExactPropertyError)
The model, or a record the resolution traversed, failed a check that
crate::exact_property applies the same way: header, missing
references, slot arity, malformed aggregates, or a construct the
declared release does not define. Reader diagnostics refuse only as
IncompleteModel when a diagnostic is of an unclassified kind, a
duplicate id the reader could not attribute, a skipped record without
an id, or when no IfcProject is left after a skipped record (#615).
MeasureNotInSchema
The declared release defines no type of this name.
Fields
schema: SchemaVersionThe release the header declares.
NotAMeasure
The type is not a measure (IFCLABEL, IFCBOOLEAN, …), so no unit
can apply to it.
UnmappedMeasureType
A measure this resolver has no verified unit correspondence for, such as a monetary, descriptive, logarithmic or list-valued measure.
UnexpectedUnit
A dimensionless measure was given an explicit unit.
DamagedRecord
The reader reported a record this resolution reads (#615): the file defines the id more than once and the model keeps one of the records, or a lenient read skipped a record with this id while another record holds it. The record the model holds cannot be shown to be the one the file meant.
Fields
NoProject
The model has no IfcProject to take a default unit from.
MultipleProjects
The model has several IfcProjects, so no one project default applies.
A single project is trusted: every release requires one
(IfcSingleProjectInstance), so a skipped second project goes
undetected.
NoProjectUnit
No unit is stated and the project assigns none of the needed type.
DuplicateProjectUnit
The project assigns two units of the needed type, which
IfcCorrectUnitAssignment forbids; neither is “the” project unit.
Fields
UnsupportedUnit
The entity is not a unit this resolver converts: not an IfcUnit at
all, or a context-dependent or monetary unit with no SI conversion.
MalformedUnit
A unit attribute that must be an enumeration constant, a positive number or a typed value is not.
Fields
UnknownPrefix
An IfcSIUnit prefix that is not an IfcSIPrefix constant.
UnknownUnitName
An IfcSIUnit name that the release’s IfcDimensionsForSiUnit does
not list, or a unit type its IfcCorrectDimensions does not list
(including USERDEFINED).
UnitTypeMismatch
The unit declares another unit type than the measure needs.
Fields
DimensionMismatch
A unit’s dimensions contradict its declared unit type, its declared
Dimensions, or the unit its conversion factor is expressed in.
Fields
UnsupportedOffset
An offset unit: IfcConversionBasedUnitWithOffset, or a unit with an
offset used where only a scale can apply (inside a derived unit or as
a conversion factor). IFC4’s prose on where the offset applies
contradicts its own Fahrenheit example (factor 1.8,
f = k * 1.8 - 459.67), so the offset is not applied until
buildingSMART settles it (IFC4.x-development#1193; tracked in #110).
CyclicConversion
Conversion-based units form a cycle.
ConversionChainTooDeep
The chain of conversion and derived units is deeper than the budget.
Trait Implementations§
Source§impl Clone for ExactUnitError
impl Clone for ExactUnitError
Source§fn clone(&self) -> ExactUnitError
fn clone(&self) -> ExactUnitError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExactUnitError
impl Debug for ExactUnitError
Source§impl Display for ExactUnitError
impl Display for ExactUnitError
impl Eq for ExactUnitError
Source§impl Error for ExactUnitError
impl Error for ExactUnitError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()