pub trait PyComplexMethods<'py>: Sealed {
    // Required methods
    fn real(&self) -> c_double;
    fn imag(&self) -> c_double;
    fn abs(&self) -> c_double;
    fn pow(&self, other: &Bound<'py, PyComplex>) -> Bound<'py, PyComplex>;
}
Expand description

Implementation of functionality for PyComplex.

These methods are defined for the Bound<'py, PyComplex> smart pointer, so to use method call syntax these methods are separated into a trait, because stable Rust does not yet support arbitrary_self_types.

Required Methods§

source

fn real(&self) -> c_double

Returns the real part of the complex number.

source

fn imag(&self) -> c_double

Returns the imaginary part of the complex number.

source

fn abs(&self) -> c_double

Returns |self|.

source

fn pow(&self, other: &Bound<'py, PyComplex>) -> Bound<'py, PyComplex>

Returns self raised to the power of other.

Implementors§

source§

impl<'py> PyComplexMethods<'py> for Bound<'py, PyComplex>