AsComplex

Trait AsComplex 

Source
pub trait AsComplex<T> {
    type Complex<A>;

    // Required method
    fn as_complex(&self, real: bool) -> Self::Complex<T>;

    // Provided methods
    fn as_re(&self) -> Self::Complex<T> { ... }
    fn as_im(&self) -> Self::Complex<T> { ... }
}
Expand description

AsComplex defines an interface for converting a reference of some numerical type into a complex number.

Required Associated Types§

Required Methods§

Source

fn as_complex(&self, real: bool) -> Self::Complex<T>

converts the current state into a complex number as either the real or imaginary part, depending on the real flag

Provided Methods§

Source

fn as_re(&self) -> Self::Complex<T>

convert a reference of the current state into the real part of a complex number

Source

fn as_im(&self) -> Self::Complex<T>

convert a reference of the current state into the imaginary part of a complex number

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.

Implementors§