Struct spinoso_math::DomainError [−][src]
Error that indicates a math function evaluated to an out of range value.
Domain errors have an associated message.
This error corresponds to the Ruby Math::DomainError
Exception class. It
can be used to differentiate between NaN
inputs and what would
be NaN
outputs.
Examples
let err = DomainError::new(); assert_eq!(err.message(), "Math::DomainError"); let err = DomainError::with_message( r#"Numerical argument is out of domain - "acos""#, ); assert_eq!(err.message(), r#"Numerical argument is out of domain - "acos""#);
Implementations
impl DomainError
[src]
#[must_use]pub const fn new() -> Self
[src]
Construct a new, default domain error.
Examples
const ERR: DomainError = DomainError::new(); assert_eq!(ERR.message(), "Math::DomainError");
#[must_use]pub const fn with_message(message: &'static str) -> Self
[src]
Construct a new, domaine error with a message.
Examples
const ERR: DomainError = DomainError::with_message( r#"Numerical argument is out of domain - "acos""#, ); assert_eq!(ERR.message(), r#"Numerical argument is out of domain - "acos""#);
#[must_use]pub const fn message(self) -> &'static str
[src]
Retrieve the exception message associated with this error.
Examples
let err = DomainError::new(); assert_eq!(err.message(), "Math::DomainError"); let err = DomainError::with_message( r#"Numerical argument is out of domain - "acos""#, ); assert_eq!(err.message(), r#"Numerical argument is out of domain - "acos""#);
Trait Implementations
impl Clone for DomainError
[src]
fn clone(&self) -> DomainError
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for DomainError
[src]
impl Debug for DomainError
[src]
impl Default for DomainError
[src]
fn default() -> DomainError
[src]
impl Display for DomainError
[src]
impl Eq for DomainError
[src]
impl Error for DomainError
[src]
pub fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<&'static str> for DomainError
[src]
impl From<DomainError> for Error
[src]
fn from(err: DomainError) -> Self
[src]
impl Hash for DomainError
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for DomainError
[src]
fn cmp(&self, other: &DomainError) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<DomainError> for DomainError
[src]
fn eq(&self, other: &DomainError) -> bool
[src]
fn ne(&self, other: &DomainError) -> bool
[src]
impl PartialOrd<DomainError> for DomainError
[src]
fn partial_cmp(&self, other: &DomainError) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for DomainError
[src]
impl StructuralPartialEq for DomainError
[src]
Auto Trait Implementations
impl RefUnwindSafe for DomainError
impl Send for DomainError
impl Sync for DomainError
impl Unpin for DomainError
impl UnwindSafe for DomainError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,