pub enum UnitResolveError {
UnknownUnit(UnitRef),
DynamicScale(UnitRef),
Overflow(RationalError),
}Expand description
Why a unit expression could not be resolved.
Carries the failing unit name so callers can produce a precise
diagnostic instead of re-scanning the expression to find it (the old
Ok(None) return conflated unknown names with dynamic scales).
Variants§
UnknownUnit(UnitRef)
A unit name in the expression is not registered.
DynamicScale(UnitRef)
A unit in the expression has a runtime-dependent scale.
Overflow(RationalError)
Dimension exponent arithmetic overflowed.
Trait Implementations§
Source§impl Clone for UnitResolveError
impl Clone for UnitResolveError
Source§fn clone(&self) -> UnitResolveError
fn clone(&self) -> UnitResolveError
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 UnitResolveError
impl Debug for UnitResolveError
Source§impl From<RationalError> for UnitResolveError
impl From<RationalError> for UnitResolveError
Source§fn from(err: RationalError) -> Self
fn from(err: RationalError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for UnitResolveError
impl PartialEq for UnitResolveError
Source§fn eq(&self, other: &UnitResolveError) -> bool
fn eq(&self, other: &UnitResolveError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for UnitResolveError
Auto Trait Implementations§
impl Freeze for UnitResolveError
impl RefUnwindSafe for UnitResolveError
impl Send for UnitResolveError
impl Sync for UnitResolveError
impl Unpin for UnitResolveError
impl UnsafeUnpin for UnitResolveError
impl UnwindSafe for UnitResolveError
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