IntoComplex

Trait IntoComplex 

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

    // Required method
    fn into_complex(self, real: bool) -> Self::Complex<T>
       where Self: Sized;

    // Provided methods
    fn into_re(self) -> Self::Complex<T>
       where Self: Sized { ... }
    fn into_im(self) -> Self::Complex<T>
       where Self: Sized { ... }
}
Expand description

Trait for converting a type into a complex number.

Required Associated Types§

Required Methods§

Source

fn into_complex(self, real: bool) -> Self::Complex<T>
where Self: Sized,

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

Provided Methods§

Source

fn into_re(self) -> Self::Complex<T>
where Self: Sized,

uses the current state as the real value of a complex number

Source

fn into_im(self) -> Self::Complex<T>
where Self: Sized,

uses the current state as the imaginary value 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§