pub struct UnitsError(/* private fields */);Expand description
Wraps a raw error code returned by the units engine.
Implementations§
Source§impl UnitsError
impl UnitsError
Sourcepub fn is_not_dimensionless(&self) -> bool
pub fn is_not_dimensionless(&self) -> bool
Returns true when the error indicates a dimensionless reduction failed.
Sourcepub fn is_invalid_unit(&self) -> bool
pub fn is_invalid_unit(&self) -> bool
Returns true when the expression was invalid (unknown/unparseable).
Trait Implementations§
Source§impl Clone for UnitsError
impl Clone for UnitsError
Source§fn clone(&self) -> UnitsError
fn clone(&self) -> UnitsError
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 moreimpl Copy for UnitsError
Source§impl Debug for UnitsError
impl Debug for UnitsError
Source§impl Display for UnitsError
impl Display for UnitsError
impl Eq for UnitsError
Source§impl Error for UnitsError
impl Error for UnitsError
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 PartialEq for UnitsError
impl PartialEq for UnitsError
Source§fn eq(&self, other: &UnitsError) -> bool
fn eq(&self, other: &UnitsError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for UnitsError
Auto Trait Implementations§
impl Freeze for UnitsError
impl RefUnwindSafe for UnitsError
impl Send for UnitsError
impl Sync for UnitsError
impl Unpin for UnitsError
impl UnsafeUnpin for UnitsError
impl UnwindSafe for UnitsError
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