pub trait F64RealOrComplex:
ComplexFloat<Real: Display>
+ AddAssign
+ SubAssign
+ Display
+ MulAssign
+ DivAssign
+ Debug
+ Sealed {
// Required methods
fn try_from_complexf64(
number: Complex<f64>,
) -> Result<Self, NotConvertibleFromComplexF64>;
fn to_complexf64(self) -> Complex<f64>;
fn from_f64(value: f64) -> Self;
fn set_re_f64(&mut self, value: f64);
fn set_im_f64(&mut self, value: f64);
fn nth_root(self, n: i32) -> Self;
}Expand description
This is an internal trait which is used to convert between f64 and
Complex<f64>-based DynQuantity structs. It needs to be public because
it is part of the type signature of DynQuantity, but it is not meant to be
implemented by external types and is therefore sealed.
Required Methods§
Sourcefn try_from_complexf64(
number: Complex<f64>,
) -> Result<Self, NotConvertibleFromComplexF64>
fn try_from_complexf64( number: Complex<f64>, ) -> Result<Self, NotConvertibleFromComplexF64>
Tries to convert from a Complex<f64> to the implementor of this trait,
either Complex<f64> or f64. The former conversion always succeeds
(is a no-op), while the latter fails if number has an imaginary component.
Sourcefn to_complexf64(self) -> Complex<f64>
fn to_complexf64(self) -> Complex<f64>
Converts a Complex<f64> or f64 to a Complex<f64>. This is
infallible (and a no-op in case of the former conversion).
Sourcefn from_f64(value: f64) -> Self
fn from_f64(value: f64) -> Self
Converts a f64 to a Complex<f64> or f64. This is infallible
(and a no-op in case of the latter conversion).
Sourcefn set_re_f64(&mut self, value: f64)
fn set_re_f64(&mut self, value: f64)
Sets the real part of the implementor to value.
Sourcefn set_im_f64(&mut self, value: f64)
fn set_im_f64(&mut self, value: f64)
Sets the imaginary part of the implementor to value. If the implementing
type is f64, this is a no-op.
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.