#[non_exhaustive]pub enum UnitConversionError {
Resolve(ExactUnitError),
DimensionMismatch {
from: [i32; 7],
to: [i32; 7],
},
MonetaryUnit {
unit: EntityId,
},
ContextDependentUnit {
unit: EntityId,
},
OffsetUnit {
name: Arc<str>,
unit: Option<EntityId>,
},
UnknownUnit {
spec: Arc<str>,
},
UnknownPrefix {
prefix: Arc<str>,
},
NonFinite {
value: f64,
},
InvalidFormat {
reason: &'static str,
},
}Expand description
Why a conversion was refused.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Resolve(ExactUnitError)
The model’s unit could not be resolved exactly (missing, malformed,
cyclic, an IfcConversionBasedUnitWithOffset …): see
ExactUnitError.
DimensionMismatch
The two units measure different quantities.
Fields
MonetaryUnit
An IfcMonetaryUnit: currencies have no fixed conversion.
ContextDependentUnit
An IfcContextDependentUnit: it states no factor into SI.
OffsetUnit
A conversion-based unit with an offset, refused until buildingSMART
settles where ConversionOffset applies (IFC4.x-development#1193,
tracked in #110).
Fields
UnknownUnit
Text that names no SI unit and no named conversion-based unit.
UnknownPrefix
An SI prefix that is not an IfcSIPrefix constant.
NonFinite
A value that is not finite.
InvalidFormat
A formatting request that cannot be met, such as a zero fraction denominator.
Trait Implementations§
Source§impl Clone for UnitConversionError
impl Clone for UnitConversionError
Source§fn clone(&self) -> UnitConversionError
fn clone(&self) -> UnitConversionError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnitConversionError
impl Debug for UnitConversionError
Source§impl Display for UnitConversionError
impl Display for UnitConversionError
Source§impl Error for UnitConversionError
impl Error for UnitConversionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ExactUnitError> for UnitConversionError
impl From<ExactUnitError> for UnitConversionError
Source§fn from(error: ExactUnitError) -> Self
fn from(error: ExactUnitError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for UnitConversionError
impl PartialEq for UnitConversionError
impl StructuralPartialEq for UnitConversionError
Auto Trait Implementations§
impl Freeze for UnitConversionError
impl RefUnwindSafe for UnitConversionError
impl Send for UnitConversionError
impl Sync for UnitConversionError
impl Unpin for UnitConversionError
impl UnsafeUnpin for UnitConversionError
impl UnwindSafe for UnitConversionError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more