pub trait ACosH: Sized {
type Error: Error;
// Required methods
fn try_acosh(self) -> Result<Self, <Self as ACosH>::Error>;
fn acosh(self) -> Self;
}Expand description
Trait for computing the inverse hyperbolic cosine of a number.
This trait defines methods for computing the inverse hyperbolic cosine of a number. Provides both a fallible method that returns a Result and a panicking method that directly returns the computed value or panics on invalid input.
§Associated Types
Error: The error type that is returned by thetry_acoshmethod. This type must implement thestd::error::Errortrait.
§Required Methods
-
try_acosh: Computes the inverse hyperbolic cosine ofselfand returns aResult. If the computation is successful, it returnsOkwith the computed value. If an error occurs, it returnsErrwith the associated error. -
acosh: Computes the inverse hyperbolic cosine ofselfand directly returns the computed value. In Debug mode this method may panic if the computation fails.
Required Associated Types§
Required Methods§
Sourcefn try_acosh(self) -> Result<Self, <Self as ACosH>::Error>
fn try_acosh(self) -> Result<Self, <Self as ACosH>::Error>
Computes the inverse hyperbolic cosine of self and returns a Result.
If the computation is successful, it returns Ok with the computed value. If an error occurs, it returns Err with the associated error.
§Errors
This method returns an error if the computation fails. The error type is defined by the associated Error type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.